tdf#75996: sw: correct bookmark positions when deleting text

Desktop / LibreOffice - Michael Stahl [redhat.com] - 29 January 2015 14:48 UTC

The problem is that SwUndoDelete will move the fully selected nodes to the UndoNodes but it leaves bookmarks with their SwIndex pointing to the deleted nodes. The SwNodeIndex are corrected by SwNodes::_MoveNodes() so they point to a different node than the SwIndex.

This only happens if only one position of the bookmark is inside the deletion range; if both are, the bookmark will be deleted by SwUndoSaveCntnt::DelCntntIndex().

Also joining the 2 start/end nodes of the selection will accidentally correct the bookmarks but only if it happens to delete the end node. (and apparently there is also a DeleteRange method that doesn't join)

370febb tdf#75996: sw: correct bookmark positions when deleting text
sw/qa/core/macros-test.cxx | 43 +++++++++++++++++++++++++++++++++++++++++
sw/source/core/undo/undel.cxx | 4 ++++
2 files changed, 47 insertions(+)

Upstream: cgit.freedesktop.org


  • Share