[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 17 11:28:04 UTC 2020


 sw/source/core/txtnode/ndtxt.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 213030a165adeb0d452fa4568b736193d5657ea6
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Aug 14 16:52:23 2020 +0100
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Mon Aug 17 13:27:30 2020 +0200

    tdf#132892 Revert "sw: paragraph-sign: erase metafields ... correctly"
    
    This reverts commit b402d0112a0bb53221b847fa372bfa3f6390a0e2.
    
    Change-Id: I210d2fded01fb952d7384b78240e32d868b08575
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100796
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    Tested-by: Jenkins

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 6adb0a93dcf6..da7a8d372d7c 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2010,7 +2010,7 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
 {
     CHECK_SWPHINTS_IF_FRM(this);
     CHECK_SWPHINTS(pDest);
-    const sal_Int32 nTextStartIdx = rStart.GetIndex();
+    sal_Int32 nTextStartIdx = rStart.GetIndex();
     sal_Int32 nDestStart = rDestStart.GetIndex();      // remember old Pos
 
     if (pDest->GetDoc()->IsClipBoard() && GetNum())
@@ -2101,6 +2101,7 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
 
     // Fetch end only now, because copying into self updates the start index
     // and all attributes
+    nTextStartIdx = rStart.GetIndex();
     const sal_Int32 nEnd = nTextStartIdx + nLen;
 
     // 2. copy attributes
@@ -2248,10 +2249,8 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
         std::reverse(metaFieldRanges.begin(), metaFieldRanges.end());
         for (const auto& pair : metaFieldRanges)
         {
-            const SwIndex aIdx(pDest, std::max<sal_Int32>(pair.first - nTextStartIdx, 0));
-            const sal_Int32 nCount = pair.second - pair.first;
-            if (nCount > 0)
-                pDest->EraseText(aIdx, nCount);
+            const SwIndex aIdx(pDest, pair.first);
+            pDest->EraseText(aIdx, pair.second - pair.first);
         }
     }
 


More information about the Libreoffice-commits mailing list