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

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 23 10:49:32 UTC 2019


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

New commits:
commit e511a0ca5dde6d731bb126bbfe21768867890102
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Sep 25 15:01:20 2019 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Wed Oct 23 12:47:56 2019 +0200

    sw: DelFullPara() and MoveRange() shouldn't do anything...
    
    Change-Id: I34bcbf4d601dd96e13efec513e8a001865f3065f
    Reviewed-on: https://gerrit.libreoffice.org/80071
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index ad031b9e702d..816468cb1368 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -1940,6 +1940,16 @@ bool DocumentContentOperationsManager::DelFullPara( SwPaM& rPam )
         return false;
     }
 
+    {
+        std::vector<std::pair<sal_uLong, sal_Int32>> Breaks;
+        lcl_CalcBreaks(Breaks, rPam);
+        if (!Breaks.empty())
+        {   // a bit of a problem: we want to completely remove the nodes
+            // but then how can the CH_TXT_ATR survive?
+            return false;
+        }
+    }
+
     // Move hard page brakes to the following Node.
     bool bSavePageBreak = false, bSavePageDesc = false;
 
@@ -2084,6 +2094,14 @@ bool DocumentContentOperationsManager::MoveRange( SwPaM& rPaM, SwPosition& rPos,
     if( !rPaM.HasMark() || *pStt >= *pEnd || (*pStt <= rPos && rPos < *pEnd))
         return false;
 
+#ifndef NDEBUG
+    {
+        std::vector<std::pair<sal_uLong, sal_Int32>> Breaks;
+        lcl_CalcBreaks(Breaks, rPaM);
+        assert(Breaks.empty()); // probably an invalid redline was created?
+    }
+#endif
+
     // Save the paragraph anchored Flys, so that they can be moved.
     SaveFlyArr aSaveFlyArr;
     SaveFlyInRange( rPaM, rPos, aSaveFlyArr, bool( SwMoveFlags::ALLFLYS & eMvFlags ) );


More information about the Libreoffice-commits mailing list