summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-10-05 11:35:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-10-05 21:24:31 +0200
commit54759fdbba24f1a552f635fc803078b8ce83dade (patch)
treede2b36c3c468e2f86a0fd21d866831012a17f1f4
parent7f94c09b8bad0d8d31e126a95ede4fa937a8981a (diff)
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@redhat.com>
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx2
-rw-r--r--sw/source/core/inc/UndoSplitMove.hxx2
-rw-r--r--sw/source/core/undo/unmove.cxx6
-rw-r--r--sw/source/core/undo/untbl.cxx2
4 files changed, 6 insertions, 6 deletions
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 :