[Libreoffice-commits] core.git: Branch 'private/mst/sw_redlinehide_2' - 3 commits - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 7 16:53:47 UTC 2018


 sw/source/core/doc/docredln.cxx |    2 ++
 sw/source/core/undo/unovwr.cxx  |    6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit b52423092ce625903fc78d4dada8a04d5b62e5e1
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Sep 7 14:27:46 2018 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Sep 7 14:27:46 2018 +0200

    sw: fix usage of wrong string in SwUndoOverwrite::RedoImpl()
    
    At this point the "aDelStr" is in the document, don't use invalid index.
    
    Change-Id: I0aae8839e9669e3a474266a345b54a1e7e6db38f

diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index 359010418053..b6f1721a0524 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -272,7 +272,7 @@ void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext)
     {
         rIdx.Assign( pTextNd, nSttContent );
         pCurrentPam->SetMark();
-        pCurrentPam->GetMark()->nContent += aInsStr.getLength();
+        pCurrentPam->GetMark()->nContent += aDelStr.getLength();
         pDoc->getIDocumentRedlineAccess().DeleteRedline( *pCurrentPam, false, USHRT_MAX );
         pCurrentPam->DeleteMark();
     }
commit f7d75be109a09d7b8044bc667fef0361f643049d
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Sep 7 14:27:30 2018 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Sep 7 14:27:30 2018 +0200

    sw: convert to assert in SwUndoOverwrite
    
    Change-Id: Iafad5a72922db35d94c836cefc53fb6be50eaaad

diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index d5652ce85e6e..359010418053 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -183,7 +183,7 @@ void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext)
     pCurrentPam->DeleteMark();
     pCurrentPam->GetPoint()->nNode = nSttNode;
     SwTextNode* pTextNd = pCurrentPam->GetNode().GetTextNode();
-    OSL_ENSURE( pTextNd, "Overwrite not in a TextNode?" );
+    assert(pTextNd);
     SwIndex& rIdx = pCurrentPam->GetPoint()->nContent;
     rIdx.Assign( pTextNd, nSttContent );
 
@@ -265,7 +265,7 @@ void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext)
     pCurrentPam->DeleteMark();
     pCurrentPam->GetPoint()->nNode = nSttNode;
     SwTextNode* pTextNd = pCurrentPam->GetNode().GetTextNode();
-    OSL_ENSURE( pTextNd, "Overwrite not in TextNode?" );
+    assert(pTextNd);
     SwIndex& rIdx = pCurrentPam->GetPoint()->nContent;
 
     if( pRedlSaveData )
commit 9aaefb06b5062635fb9bef7c8aef4df2584bff7a
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Sep 7 13:36:02 2018 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Sep 7 13:36:02 2018 +0200

    sw: add some asserts in CheckPosition()
    
    This checks stuff but doesn't complain in any way if it fails, so try to
    make it useful.
    
    Change-Id: I5d52ea020226f1ffc4fda6533761930ac0d7051d

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 716cdfc6c2d7..7d1903a72df4 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -122,8 +122,10 @@ bool CheckPosition( const SwPosition* pStt, const SwPosition* pEnd )
     while( pEndStart && (!pEndStart->IsStartNode() || pEndStart->IsSectionNode() ||
         pEndStart->IsTableNode() ) )
         pEndStart = pEndStart->StartOfSectionNode();
+    assert(pSttTab == pEndTab);
     if( pSttTab != pEndTab )
         nError = 1;
+    assert(pSttTab || pSttStart == pEndStart);
     if( !pSttTab && pSttStart != pEndStart )
         nError |= 2;
     if( nError )


More information about the Libreoffice-commits mailing list