Review Request 108868: fix KoTextWriter::saveParagraph(...) to not crash on QTextDocuments without a KoTextRangeManager

Friedrich W. H. Kossebau kossebau at kde.org
Fri Feb 8 20:57:27 GMT 2013


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

Review request for Calligra and C. Boemann.


Description
-------

I remember we talked about and decided to not add a check into the code but instead make sure in all places that a rangemanager is set on any QTextDocument. Seems we failed on this. And we may fail in the future, as there is nothing in the code which enforces this requirement.

So I now think it is better to have a slightly more complex code which checks if there is such a rangemanger, instead of blindly relying on that there is one. The only thing left for us is to refactor this code, to reduce the complexity. Or to introduce the use of a subclass of QTextDocument which makes sure there is always a rangemanager.

Patch changes code to do what is done for other optional properties of QTextDocument in other places, checks if the property exists and only then uses it.

Okay to backport to 2.6.0?


This addresses bug 314676.
    http://bugs.kde.org/show_bug.cgi?id=314676


Diffs
-----

  libs/kotext/opendocument/KoTextWriter_p.cpp 4ac1558 

Diff: http://git.reviewboard.kde.org/r/108868/diff/


Testing
-------

Crash as reported in the bug does no longer happen for me.


Thanks,

Friedrich W. H. Kossebau

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20130208/7e8420d8/attachment.htm>


More information about the calligra-devel mailing list