fix KoXmlReader to break on error instead of trying on and on

Review Request #110719 - Created May 29, 2013 and submitted

Information
Friedrich W. H. Kossebau
calligra
Reviewers
calligra
Words currently will hang with hot wheels on loading the file http://heap.kogmbh.net/vandenoever/tmp/yo.odt

Reason is that the condition to break the parsing is only testing if the end is officially reached. But as the API Dox of QXmlStreamReader::readNext() ( http://qt-project.org/doc/qt-4.8/qxmlstreamreader.html#readNext) tells "The exception is when error() returns PrematureEndOfDocumentError. This error is reported when the end of an otherwise well-formed chunk of XML is reached, but the chunk doesn't represent a complete XML document."

So also checking for !xml.hasError() seems needed.

Okay to backport to 2.7?


Now this bug was just uncovered because of another problem:
for some reason the file meta.xml seems to be not properly extracted from the odt, so this can be seen in the log (with this patch applied):

words(17718)/koffice (lib komain): Parsing error in  "meta.xml" ! Aborting! 
 In line:  1 , column:  0 
 Error message:  "Premature end of document." 

Unzipping yo.odt with unzip shows that meta.xml has some proper looking content. So possibly our zip reading code has a bug. Needs to be investigated separately.

  
Camilla Boemann
Commit Hook
Commit Hook
Friedrich W. H. Kossebau
Review request changed

Status: Closed (submitted)

Loading...