summaryrefslogtreecommitdiff
path: root/sw/source/core/undo/unmove.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/undo/unmove.cxx')
-rw-r--r--sw/source/core/undo/unmove.cxx27
1 files changed, 13 insertions, 14 deletions
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx
index 364f75c5a745..a29a0afa4ea2 100644
--- a/sw/source/core/undo/unmove.cxx
+++ b/sw/source/core/undo/unmove.cxx
@@ -28,17 +28,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <UndoSplitMove.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <pam.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <ndtxt.hxx>
-#include <undobj.hxx>
+#include <UndoCore.hxx>
#include <rolbck.hxx>
-inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); }
-
// MOVE
SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
@@ -79,7 +79,8 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos )
pHistory->CopyFmtAttr( *pEndTxtNd->GetpSwAttrSet(), nEndNode );
}
- if( 0 != (pTxtNd = rRange.GetDoc()->GetNodes()[ rMvPos.nNode ]->GetTxtNode() ))
+ pTxtNd = rMvPos.nNode.GetNode().GetTxtNode();
+ if (0 != pTxtNd)
{
pHistory->Add( pTxtNd->GetTxtColl(), nMvDestNode, ND_TEXTNODE );
if ( pTxtNd->GetpSwpHints() )
@@ -187,11 +188,9 @@ void SwUndoMove::SetDestRange( const SwNodeIndex& rStt,
}
-void SwUndoMove::Undo( SwUndoIter& rUndoIter )
+void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
{
- SwDoc* pDoc = &rUndoIter.GetDoc();
- sal_Bool bUndo = pDoc->DoesUndo();
- pDoc->DoUndo( sal_False );
+ SwDoc *const pDoc = & rContext.GetDoc();
// Block, damit aus diesem gesprungen werden kann
do {
@@ -276,18 +275,18 @@ void SwUndoMove::Undo( SwUndoIter& rUndoIter )
pHistory->SetTmpEnd( pHistory->Count() );
}
- pDoc->DoUndo( bUndo );
-
// setze noch den Cursor auf den Undo-Bereich
if( !bMoveRange )
- SetPaM( rUndoIter );
+ {
+ AddUndoRedoPaM(rContext);
+ }
}
-void SwUndoMove::Redo( SwUndoIter& rUndoIter )
+void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext)
{
- SwPaM* pPam = rUndoIter.pAktPam;
- SwDoc& rDoc = *pPam->GetDoc();
+ SwPaM *const pPam = & AddUndoRedoPaM(rContext);
+ SwDoc & rDoc = rContext.GetDoc();
SwNodes& rNds = rDoc.GetNodes();
SwNodeIndex aIdx( rNds, nMvDestNode );