diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-04-05 21:09:45 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-04-09 12:31:12 +0200 |
commit | 8a23c7137bef301ecaa8e486abc40fa4eaf7a273 (patch) | |
tree | 3ba24513daae77f742723aac53232fddb34cd1a9 /sw/qa/extras/uiwriter | |
parent | 5c9bc4f119728a327f03c9a1964094be6dd1af60 (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>
(cherry picked from commit 5d41c2461642364b7159398024acccbee12f6e3e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132589
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sw/qa/extras/uiwriter')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index d626d5a9d6ec..1e6f8be07b06 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -1570,7 +1570,7 @@ void SwUiWriterTest::testBookmarkUndo() CPPUNIT_ASSERT(bool(pMarkAccess->findMark("Mark") == pMarkAccess->getAllMarksEnd())); CPPUNIT_ASSERT(pMarkAccess->findMark("Mark_") != pMarkAccess->getAllMarksEnd()); - pMarkAccess->deleteMark( pMarkAccess->findMark("Mark_") ); + pMarkAccess->deleteMark(pMarkAccess->findMark("Mark_"), false); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount()); rUndoManager.Undo(); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount()); @@ -1878,7 +1878,7 @@ void SwUiWriterTest::testTdf51741() CPPUNIT_ASSERT(bool(pMarkAccess->findMark("Mark") == pMarkAccess->getAllMarksEnd())); CPPUNIT_ASSERT(pMarkAccess->findMark("Mark_") != pMarkAccess->getAllMarksEnd()); //Modification 7 - pMarkAccess->deleteMark( pMarkAccess->findMark("Mark_") ); + pMarkAccess->deleteMark(pMarkAccess->findMark("Mark_"), false); CPPUNIT_ASSERT(pWrtShell->IsModified()); pWrtShell->ResetModified(); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount()); |