summaryrefslogtreecommitdiff
path: root/sw/source/uibase/dochdl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-04-04 20:11:50 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-04-05 21:06:38 +0200
commit5d41c2461642364b7159398024acccbee12f6e3e (patch)
tree14cfad66691558228270bf161e388683b9054442 /sw/source/uibase/dochdl
parent8f80986d6209bb79c44ca03c1f7b69c55cd9a854 (diff)
forcepoint#104 sw: do not delete fieldmark chars in MoveNodeRange()
The problem is that SwXTextTableCursor::mergeRange() wants to move some nodes, and the deleteMarks() deletes a fieldmark creating a SaveBookmark but it contains the positions relative to the CH_TXT_ATR_FIELD* still in the text, while deleting the fieldmark of course removes these. The SaveBookmark would need to adjust the indexes and store the separator position too and the vector would need to be restored in reverse order. But every time the SaveBookmarks are created, they are restored as well, so it looks simpler to just suppress deleting the CH_TXT_ATR_FIELD* in this case, and inserting them too (latter is already done when copying text). Change-Id: I690c6432a38eab6dec10adff74e638f0e52cca55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132531 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/source/uibase/dochdl')
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 7eccec3e1196..8ae7f1c964aa 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -4458,7 +4458,7 @@ bool SwTransferDdeLink::WriteData( SvStream& rStrm )
// remove mark
rServerObject.SetNoServer(); // this removes the connection between SwServerObject and mark
// N.B. ppMark was not loaded from file and cannot have xml:id
- pMarkAccess->deleteMark(ppMark);
+ pMarkAccess->deleteMark(ppMark, false);
// recreate as Bookmark
::sw::mark::IMark* const pNewMark = pMarkAccess->makeMark(
@@ -4493,7 +4493,7 @@ void SwTransferDdeLink::Disconnect( bool bRemoveDataAdvise )
bool bIsModified = pDoc->getIDocumentState().IsModified();
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
- pMarkAccess->deleteMark(pMarkAccess->findMark(m_sName));
+ pMarkAccess->deleteMark(pMarkAccess->findMark(m_sName), false);
if( !bIsModified )
pDoc->getIDocumentState().ResetModified();