Summary: | Testcase where .doc import gives message "Could not open xxx.doc. Reason: Internal error" | ||
---|---|---|---|
Product: | [Applications] calligrawords | Reporter: | Thomas Fischer <fischer> |
Component: | doc | Assignee: | Matus Uzak <matus.uzak> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | matus.uzak, sebsauer, swathi.vegesna999 |
Priority: | NOR | ||
Version: | 2.4-snapshots | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Test case where import fails |
Description
Thomas Fischer
2011-09-01 11:33:45 UTC
Created attachment 63284 [details]
Test case where import fails
Easy fix for the problem; diff --git a/filters/words/msword-odf/wv2/src/styles.cpp b/filters/words/msword-odf/wv2/src/styles.cpp index fcc0902..e7d93e2 100644 --- a/filters/words/msword-odf/wv2/src/styles.cpp +++ b/filters/words/msword-odf/wv2/src/styles.cpp @@ -377,7 +377,7 @@ bool STD::readStyleName( const U16 stdfSize, const U16 stdBytesLeft, OLEStreamRe //Each name, whether primary or alternate, MUST NOT be empty and MUST //be unique within all names in the stylesheet. - if ( ((length * 2) > stdBytesLeft) || (length == 0) ) { + if ( ((length * 2) > stdBytesLeft) /*|| (length == 0)*/ ) { wvlog << "xstzName length invalid"; return false; } The proper fix would be to figure out why the xstzName has a length of zero what is according to the specs invalid. Maybe that just means that we need to skip + ignore the style? Or maybe it means we need to use an generated name (so, it's a defined but unused style)? Or there is still some undocumented thing going on :-/ I'm getting the "Invalid File Format" message. Git commit 7cb94839a9ba53f7c297f31ad5d148f697bdda28 by Matus Uzak. Committed on 09/09/2011 at 16:14. Pushed by uzak into branch 'master'. DOC: Updated processing of invalid user defined styles. * If the only problem of a user defined style is an invalid style name, let's generate a unique style name for it. We could use the corresponding default style, but a lot of modifications would be required for both wv2 and handlers. Let's keep it simple. BUG:281166 M +40 -38 filters/words/msword-odf/wv2/src/styles.cpp M +15 -4 filters/words/msword-odf/wv2/src/styles.h http://commits.kde.org/calligra/7cb94839a9ba53f7c297f31ad5d148f697bdda28 In git commit 79697867a34448f3472bbd3243247cb141ee11bf ,test data opens fine . |