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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 5 19:24:45 UTC 2020


 sw/source/core/frmedt/tblsel.cxx    |    2 +-
 sw/source/core/inc/UndoTable.hxx    |    2 +-
 sw/source/core/table/swnewtable.cxx |    2 +-
 sw/source/core/undo/untbl.cxx       |    8 ++++----
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 7f94c09b8bad0d8d31e126a95ede4fa937a8981a
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Oct 5 11:31:47 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Oct 5 21:24:03 2020 +0200

    SwUndoTableMerge::MoveBoxContent always dereferences its SwDoc* arg
    
    Change-Id: I38472e475c6cb7f96b414d107301a04bbb73c0fd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103958
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index cc4e546d4306..81ab48f4accd 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -1381,7 +1381,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
             SwNodeRange aRg( aSttNdIdx, aPam.GetPoint()->nNode );
             ++rInsPosNd;
             if( pUndo )
-                pUndo->MoveBoxContent( pDoc, aRg, rInsPosNd );
+                pUndo->MoveBoxContent( *pDoc, aRg, rInsPosNd );
             else
             {
                 pDoc->getIDocumentContentOperations().MoveNodeRange( aRg, rInsPosNd,
diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index 88c3b10dbb31..331786b4e933 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -224,7 +224,7 @@ public:
     virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
     virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
 
-    void MoveBoxContent( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& rPos );
+    void MoveBoxContent( SwDoc& rDoc, SwNodeRange& rRg, SwNodeIndex& rPos );
 
     void SetSelBoxes( const SwSelBoxes& rBoxes );
 
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 48a97ff0eac4..ecd3bee01d1d 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -905,7 +905,7 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes,
                     }
                     SwNodeRange aRg( aSttNdIdx, aPam.GetPoint()->nNode );
                     if( pUndo )
-                        pUndo->MoveBoxContent( pDoc, aRg, rInsPosNd );
+                        pUndo->MoveBoxContent( *pDoc, aRg, rInsPosNd );
                     else
                     {
                         pDoc->getIDocumentContentOperations().MoveNodeRange( aRg, rInsPosNd,
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 0df50f847820..59f4a0e3cff8 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -2002,12 +2002,12 @@ void SwUndoTableMerge::RedoImpl(::sw::UndoRedoContext & rContext)
     rDoc.MergeTable(rPam);
 }
 
-void SwUndoTableMerge::MoveBoxContent( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& rPos )
+void SwUndoTableMerge::MoveBoxContent( SwDoc& rDoc, SwNodeRange& rRg, SwNodeIndex& rPos )
 {
     SwNodeIndex aTmp( rRg.aStart, -1 ), aTmp2( rPos, -1 );
-    std::unique_ptr<SwUndoMove> pUndo(new SwUndoMove( pDoc, rRg, rPos ));
-    ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
-    pDoc->getIDocumentContentOperations().MoveNodeRange( rRg, rPos, m_pSaveTable->IsNewModel() ?
+    std::unique_ptr<SwUndoMove> pUndo(new SwUndoMove( &rDoc, rRg, rPos ));
+    ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
+    rDoc.getIDocumentContentOperations().MoveNodeRange( rRg, rPos, m_pSaveTable->IsNewModel() ?
         SwMoveFlags::NO_DELFRMS :
         SwMoveFlags::DEFAULT );
     ++aTmp;


More information about the Libreoffice-commits mailing list