Review Request: fix saving of textranges in KoTextWriter::Private::saveParagraph(...)

Friedrich W. H. Kossebau kossebau at kde.org
Wed Dec 5 18:12:16 GMT 2012


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

Review request for Calligra and C. Boemann.


Description
-------

After lots of experiments here finally something relatively elegant (though you should have seen my intermediate hacks to understand ;) ).

Fixes the bugs seen with e.g. orpheus on saving bookmarks, at least for me. I think/hope I catched all cases which can be there by the parameters from & to, the possible textblock contents and the possible textranges.
Usage of KoTextRangeManager::textRangesChangingWithin(...) and KoTextRange::saveOdf(...) can be surely improved, but for now this here is at least a working fix.

Here my rationale for the patch:
Start and end tags of textranges can appear on positions in a text block.
in front of the first text element, between the elements, or behind the last.
A textblock is composed of no or many text fragments.
If there is no element at all, the only possible position is 0 (relative to the
begin of the block).
Start tags are ideally written in front of the content they are tagging,
and not behind the previous content. That way tags which are at the very begin
of the text do not need special handling.
End tags are ideally written directly behind the content, and not in front of
the next content. That way end tags which are at the very end of the text
do not need special handling.
Then there is the case of start tags which are at the final position of a text block:
the content they belong to includes the block end/border, so they need to be
written at the place of the last position.


Diffs
-----

  libs/kotext/KoAnnotation.h 0dfb43c 
  libs/kotext/KoAnnotation.cpp a700f02 
  libs/kotext/KoBookmark.h c64cbe1 
  libs/kotext/KoBookmark.cpp 5538e5f 
  libs/kotext/KoTextRange.h c728798 
  libs/kotext/opendocument/KoTextWriter_p.cpp 9cc353c 

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


Testing
-------

Oh yes. Created reports with lots of tables & charts, updated them, saved, updated, loaded, updated, added new tables & charts, updated, saved, updated, loaded, .... And no longer any issue then, so far.


Thanks,

Friedrich W. H. Kossebau

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20121205/02660cff/attachment.htm>


More information about the calligra-devel mailing list