summaryrefslogtreecommitdiff
path: root/sw/qa/core/macros-test.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-09-27 15:55:43 +0200
committerAndras Timar <andras.timar@collabora.com>2017-09-29 17:14:36 +0200
commit26a7713002980adb19aec8fa878cb42d076dc3a0 (patch)
treef9dc906d88693a63da890f610adff55e57ad670b /sw/qa/core/macros-test.cxx
parentc8c26b466f28222618b2edae15d66eb7ad020e67 (diff)
tdf#112679 sw: fix copying of fieldmarks
Aha, now we know that the reason for the defensive programming in lcl_AssureFieldMarksSet() was that there are actually 2 different use-cases for it: usually a new mark is inserted, so there are no dummy characters and they must be inserted. However when copying text, the dummy characters are copied too, so they must not be inserted, or we get duplicate fieldmarks. This also reverts commit d4036d3a89b65a4912f62e3930eb1a31cd90a16b which fixed the problem only for CHECKBOX_FIELDMARK in a different way. (regression from bb069fe7b8b6a24f9ff4df4c7052961e17ea3a8c) (cherry picked from commit 421a23bb36bbf51edfabc58b7d2cd28ad37719d0) Change-Id: I3c99b8c6d720951655198e682018794337859373 Reviewed-on: https://gerrit.libreoffice.org/42938 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw/qa/core/macros-test.cxx')
-rw-r--r--sw/qa/core/macros-test.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index 88e4e1116304..05dea3607884 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -209,7 +209,8 @@ void SwMacrosTest::testBookmarkDeleteAndJoin()
aPaM.Move(fnMoveForward, GoInDoc);
IDocumentMarkAccess & rIDMA = *pDoc->getIDocumentMarkAccess();
sw::mark::IMark *pMark =
- rIDMA.makeMark(aPaM, "test", IDocumentMarkAccess::MarkType::BOOKMARK);
+ rIDMA.makeMark(aPaM, "test", IDocumentMarkAccess::MarkType::BOOKMARK,
+ ::sw::mark::InsertMode::New);
CPPUNIT_ASSERT(pMark);
// select so pMark start position is on a node that is fully deleted
aPaM.Move(fnMoveBackward, GoInNode);
@@ -243,7 +244,8 @@ void SwMacrosTest::testBookmarkDeleteTdf90816()
aPaM.Move(fnMoveBackward, GoInContent);
IDocumentMarkAccess & rIDMA = *pDoc->getIDocumentMarkAccess();
sw::mark::IMark *pMark =
- rIDMA.makeMark(aPaM, "test", IDocumentMarkAccess::MarkType::BOOKMARK);
+ rIDMA.makeMark(aPaM, "test", IDocumentMarkAccess::MarkType::BOOKMARK,
+ ::sw::mark::InsertMode::New);
CPPUNIT_ASSERT(pMark);
// delete the same selection as the bookmark