[Libreoffice-commits] core.git: sw/source

Mike Kaganski mike.kaganski at collabora.com
Fri Feb 10 08:48:04 UTC 2017


 sw/source/core/doc/DocumentContentOperationsManager.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit d4036d3a89b65a4912f62e3930eb1a31cd90a16b
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Tue Feb 7 12:20:10 2017 +0300

    tdf#105625 related: don't duplicate dummy character on copy
    
    Change-Id: I5881887c7a0fd0c9ccd954a36482a3ada5103098
    Reviewed-on: https://gerrit.libreoffice.org/34025
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 88d5bfd..1e7ce9d 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -266,6 +266,15 @@ namespace
                 lcl_SetCpyPos(pMark->GetOtherMarkPos(), rStt, *pCpyStt, *aTmpPam.GetMark(), nDelCount);
             }
 
+            const IDocumentMarkAccess::MarkType aMarkType = IDocumentMarkAccess::GetType(*pMark);
+            if (aMarkType == IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK)
+            {
+                // Node's CopyText() copies also dummy characters, which need to be removed
+                // (they will be added later in MarkBase::InitDoc inside IDocumentMarkAccess::makeMark)
+                // CHECKBOX_FIELDMARK doesn't contain any other data in its range, so just clear it
+                pDestDoc->getIDocumentContentOperations().DeleteRange(aTmpPam);
+            }
+
             ::sw::mark::IMark* const pNewMark = pDestDoc->getIDocumentMarkAccess()->makeMark(
                 aTmpPam,
                 pMark->GetName(),


More information about the Libreoffice-commits mailing list