diff options
Diffstat (limited to 'sw/source/core/undo/unmove.cxx')
-rw-r--r-- | sw/source/core/undo/unmove.cxx | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx index 4c5fbca4085c..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 ) @@ -47,7 +47,7 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos ) nMvDestCntnt( rMvPos.nContent.GetIndex() ), bMoveRedlines( false ) { - bMoveRange = bJoinNext = bJoinPrev = FALSE; + bMoveRange = bJoinNext = bJoinPrev = sal_False; // StartNode vorm loeschen von Fussnoten besorgen! SwDoc* pDoc = rRange.GetDoc(); @@ -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() ) @@ -106,8 +107,8 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg, nMvDestNode( rMvPos.GetIndex() ), bMoveRedlines( false ) { - bMoveRange = TRUE; - bJoinNext = bJoinPrev = FALSE; + bMoveRange = sal_True; + bJoinNext = bJoinPrev = sal_False; nSttCntnt = nEndCntnt = nMvDestCntnt = STRING_MAXLEN; @@ -117,7 +118,7 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg, // DelFtn( rRange ); // wird aus dem CntntBereich in den Sonderbereich verschoben ? - ULONG nCntntStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex(); + sal_uLong nCntntStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex(); if( nMvDestNode < nCntntStt && rRg.aStart.GetIndex() > nCntntStt ) { // loesche alle Fussnoten. Diese sind dort nicht erwuenscht. @@ -142,7 +143,7 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg, void SwUndoMove::SetDestRange( const SwPaM& rRange, const SwPosition& rInsPos, - BOOL bJoin, BOOL bCorrPam ) + sal_Bool bJoin, sal_Bool bCorrPam ) { const SwPosition *pStt = rRange.Start(), *pEnd = rRange.GetPoint() == pStt @@ -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(); - BOOL bUndo = pDoc->DoesUndo(); - pDoc->DoUndo( FALSE ); + SwDoc *const pDoc = & rContext.GetDoc(); // Block, damit aus diesem gesprungen werden kann do { @@ -217,7 +216,7 @@ void SwUndoMove::Undo( SwUndoIter& rUndoIter ) // #i17764# if redlines are to be moved, we may not remove them before // pDoc->Move gets a chance to handle them if( ! bMoveRedlines ) - RemoveIdxFromRange( aPam, FALSE ); + RemoveIdxFromRange( aPam, sal_False ); SwPosition aPos( *pDoc->GetNodes()[ nInsPosNode] ); SwCntntNode* pCNd = aPos.nNode.GetNode().GetCntntNode(); @@ -238,7 +237,7 @@ void SwUndoMove::Undo( SwUndoIter& rUndoIter ) aPam.Exchange(); aPam.DeleteMark(); -// pDoc->ResetAttr( aPam, FALSE ); +// pDoc->ResetAttr( aPam, sal_False ); if( aPam.GetNode()->IsCntntNode() ) aPam.GetNode()->GetCntntNode()->ResetAllAttr(); // der Pam wird jetzt aufgegeben. @@ -266,7 +265,7 @@ void SwUndoMove::Undo( SwUndoIter& rUndoIter ) pTxtNd->JoinNext(); } - } while( FALSE ); + } while( sal_False ); if( pHistory ) { @@ -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 ); @@ -308,10 +307,10 @@ void SwUndoMove::Redo( SwUndoIter& rUndoIter ) nMvDestCntnt )); DelFtn( aPam ); - RemoveIdxFromRange( aPam, FALSE ); + RemoveIdxFromRange( aPam, sal_False ); aIdx = aPam.Start()->nNode; - BOOL bJoinTxt = aIdx.GetNode().IsTxtNode(); + sal_Bool bJoinTxt = aIdx.GetNode().IsTxtNode(); aIdx--; rDoc.MoveRange( aPam, aMvPos, @@ -341,7 +340,7 @@ void SwUndoMove::DelFtn( const SwPaM& rRange ) { // wird aus dem CntntBereich in den Sonderbereich verschoben ? SwDoc* pDoc = rRange.GetDoc(); - ULONG nCntntStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex(); + sal_uLong nCntntStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex(); if( nMvDestNode < nCntntStt && rRange.GetPoint()->nNode.GetIndex() >= nCntntStt ) { |