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

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


 sw/source/core/doc/DocumentContentOperationsManager.cxx |    2 +-
 sw/source/core/inc/UndoSplitMove.hxx                    |    2 +-
 sw/source/core/undo/unmove.cxx                          |    6 +++---
 sw/source/core/undo/untbl.cxx                           |    2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 54759fdbba24f1a552f635fc803078b8ce83dade
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Oct 5 11:35:33 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Oct 5 21:24:31 2020 +0200

    SwUndoMove ctor is never passed a null SwDoc*
    
    Change-Id: Iaf80504a8bcbca0d1afa101d30376ca2ce3506f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103959
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index ea9fd3f0c07d..e63b0cf41bfe 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -2469,7 +2469,7 @@ bool DocumentContentOperationsManager::MoveNodeRange( SwNodeRange& rRange, SwNod
     std::unique_ptr<SwUndoMove> pUndo;
     if ((SwMoveFlags::CREATEUNDOOBJ & eMvFlags ) && m_rDoc.GetIDocumentUndoRedo().DoesUndo())
     {
-        pUndo.reset(new SwUndoMove( &m_rDoc, rRange, rPos ));
+        pUndo.reset(new SwUndoMove( m_rDoc, rRange, rPos ));
     }
     else
     {
diff --git a/sw/source/core/inc/UndoSplitMove.hxx b/sw/source/core/inc/UndoSplitMove.hxx
index 44a3a8e970cf..de158ed5e642 100644
--- a/sw/source/core/inc/UndoSplitMove.hxx
+++ b/sw/source/core/inc/UndoSplitMove.hxx
@@ -63,7 +63,7 @@ class SwUndoMove : public SwUndo, private SwUndRng, private SwUndoSaveContent
 
 public:
     SwUndoMove( const SwPaM&, const SwPosition& );
-    SwUndoMove( SwDoc* pDoc, const SwNodeRange&, const SwNodeIndex& );
+    SwUndoMove( SwDoc& rDoc, const SwNodeRange&, const SwNodeIndex& );
 
     virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
     virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx
index abe14f49bb31..04b10cb900a6 100644
--- a/sw/source/core/undo/unmove.cxx
+++ b/sw/source/core/undo/unmove.cxx
@@ -91,9 +91,9 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
         m_pHistory.reset();
 }
 
-SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg,
+SwUndoMove::SwUndoMove( SwDoc& rDoc, const SwNodeRange& rRg,
                         const SwNodeIndex& rMvPos )
-    : SwUndo(SwUndoId::MOVE, pDoc)
+    : SwUndo(SwUndoId::MOVE, &rDoc)
     , m_nDestStartNode(0)
     , m_nDestEndNode(0)
     , m_nInsPosNode(0)
@@ -115,7 +115,7 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg,
 // FIXME: duplication of the method body of DelFootnote below
 
     // is the current move from ContentArea into the special section?
-    sal_uLong nContentStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex();
+    sal_uLong nContentStt = rDoc.GetNodes().GetEndOfAutotext().GetIndex();
     if( m_nMoveDestNode < nContentStt && rRg.aStart.GetIndex() > nContentStt )
     {
         // delete all footnotes since they are undesired there
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 59f4a0e3cff8..9654a9561ff4 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -2005,7 +2005,7 @@ void SwUndoTableMerge::RedoImpl(::sw::UndoRedoContext & rContext)
 void SwUndoTableMerge::MoveBoxContent( SwDoc& rDoc, SwNodeRange& rRg, SwNodeIndex& rPos )
 {
     SwNodeIndex aTmp( rRg.aStart, -1 ), aTmp2( rPos, -1 );
-    std::unique_ptr<SwUndoMove> pUndo(new SwUndoMove( &rDoc, rRg, rPos ));
+    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 :


More information about the Libreoffice-commits mailing list