Version: 2.4-snapshots (using KDE 4.6.5) OS: Linux Opening attached file as downloaded from http://yia.org.ua/apl/partnership_indetification_5.doc gives error message: Could not open /tmp/partnership_indetification_5.doc. Reason: Internal error Reproducible: Didn't try Steps to Reproduce: Open attached file. Actual Results: See error message appearing immediately. Expected Results: File should be opened just as LibreOffice does.
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 .