Review Request: Bug in KoXml* to QDom* conversion

Dag Andersen danders at get2net.dk
Wed Jan 11 14:24:21 GMT 2012



> On Jan. 11, 2012, 12:18 p.m., Jaime Torres Amate wrote:
> > libs/odf/tests/TestXmlReaderWithoutSpaces.cpp, line 1293
> > <http://git.reviewboard.kde.org/r/103674/diff/1/?file=46434#file46434line1293>
> >
> >     testXMLReaderWithoutSpaces was a clone of testXMLReader, except that the xmlstreams should not contain whitespaces/tabs/newlinews between nodes.
> >     
> >     Therefore, your change here is incorrect.

Ahh, yes fixed.


- Dag


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103674/#review9739
-----------------------------------------------------------


On Jan. 11, 2012, 2:21 p.m., Dag Andersen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103674/
> -----------------------------------------------------------
> 
> (Updated Jan. 11, 2012, 2:21 p.m.)
> 
> 
> Review request for Calligra.
> 
> 
> Description
> -------
> 
> Symptom:
> Plan (sometimes) crashes and valgrind reports "Invalid read size".
> 
> When KoXml* is converted to QDom* a temporary QDomDocument is used to create nodes.
> This results in deleted nodes when the document goes out of scope.
> From QDomDocument api docs:
> "Since elements, text nodes, comments, processing instructions, etc., cannot exist outside the context of a document, the document class also contains the factory functions needed to create these objects. The node objects created have an ownerDocument() function which associates them with the document within whose context they were created."
> 
> In short the patch passes ownerDoc as a reference and appends the converted nodes to the ownerDoc.
> Also asQDomNode()/asQDomElement() does not return anything, the node must be found in ownerDoc.
> 
> Modifications to the users is not included.
> 
> Note that the patch is not quite finished because I don't understand the TestXmlReaderWithoutSpaces unit test.
> 
> 
> Diffs
> -----
> 
>   libs/odf/KoXmlReader.h 231651c 
>   libs/odf/KoXmlReader.cpp 13a6d47 
>   libs/odf/tests/TestXmlReader.cpp 6631b64 
>   libs/odf/tests/TestXmlReaderWithoutSpaces.cpp 5179846 
> 
> Diff: http://git.reviewboard.kde.org/r/103674/diff/diff
> 
> 
> Testing
> -------
> 
> Unit test passes (but it did before too).
> No crash in Plan.
> 
> 
> Thanks,
> 
> Dag Andersen
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20120111/460b4491/attachment.htm>


More information about the calligra-devel mailing list