From 26a7713002980adb19aec8fa878cb42d076dc3a0 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 27 Sep 2017 15:55:43 +0200 Subject: 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 Tested-by: Andras Timar --- sw/source/uibase/dochdl/swdtflvr.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sw/source/uibase/dochdl') diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 5e58c085519c..11bf214019f7 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -3773,7 +3773,8 @@ bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) ::sw::mark::IMark* const pNewMark = pMarkAccess->makeMark( aPaM, sMarkName, - IDocumentMarkAccess::MarkType::BOOKMARK); + IDocumentMarkAccess::MarkType::BOOKMARK, + ::sw::mark::InsertMode::New); rServerObject.SetDdeBookmark(*pNewMark); } -- cgit