diff options
author | Michael Stahl <mst@openoffice.org> | 2010-11-25 14:31:08 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-11-25 14:31:08 +0100 |
commit | 3145216b7e60ac552669266e89acc92c09ce059f (patch) | |
tree | 209f2393c7b0216fcd9f29c8c75207cb5b86c3db /sw/source/core/edit/ednumber.cxx | |
parent | 89071dd67bb173a489a5286da21b7623dad8c6e5 (diff) |
unodapi: #i115383#: SwDoc:
remove the forwarding implementation of IDocumentUndoRedo from SwDoc.
instead call the UndoManager directly, via SwDoc::GetIDocumentUndoRedo().
Diffstat (limited to 'sw/source/core/edit/ednumber.cxx')
-rw-r--r-- | sw/source/core/edit/ednumber.cxx | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index ea1088f36f69..f5b2ef0fb2b9 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -33,6 +33,7 @@ #include <editsh.hxx> #include <edimp.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <ndtxt.hxx> #include <paratr.hxx> #include <swundo.hxx> @@ -153,12 +154,12 @@ BOOL SwEditShell::NoNum() SwPaM* pCrsr = GetCrsr(); if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ? { - GetDoc()->StartUndo( UNDO_START, NULL ); + GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); for( USHORT n = 0; n < aRangeArr.Count(); ++n ) bRet = bRet && GetDoc()->NoNum( aRangeArr.SetPam( n, aPam )); - GetDoc()->EndUndo( UNDO_END, NULL ); + GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } else bRet = GetDoc()->NoNum( *pCrsr ); @@ -217,14 +218,14 @@ void SwEditShell::DelNumRules() SwPaM* pCrsr = GetCrsr(); if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ? { - GetDoc()->StartUndo( UNDO_START, NULL ); + GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); for( USHORT n = 0; n < aRangeArr.Count(); ++n ) { GetDoc()->DelNumRules( aRangeArr.SetPam( n, aPam ) ); } - GetDoc()->EndUndo( UNDO_END, NULL ); + GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } else GetDoc()->DelNumRules( *pCrsr ); @@ -255,12 +256,12 @@ BOOL SwEditShell::NumUpDown( BOOL bDown ) bRet = GetDoc()->NumUpDown( *pCrsr, bDown ); else { - GetDoc()->StartUndo( UNDO_START, NULL ); + GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); for( USHORT n = 0; n < aRangeArr.Count(); ++n ) bRet = bRet && GetDoc()->NumUpDown( aRangeArr.SetPam( n, aPam ), bDown ); - GetDoc()->EndUndo( UNDO_END, NULL ); + GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } GetDoc()->SetModified(); @@ -517,13 +518,13 @@ BOOL SwEditShell::OutlineUpDown( short nOffset ) bRet = GetDoc()->OutlineUpDown( *pCrsr, nOffset ); else { - GetDoc()->StartUndo( UNDO_START, NULL ); + GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); for( USHORT n = 0; n < aRangeArr.Count(); ++n ) bRet = bRet && GetDoc()->OutlineUpDown( aRangeArr.SetPam( n, aPam ), nOffset ); - GetDoc()->EndUndo( UNDO_END, NULL ); + GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } GetDoc()->SetModified(); EndAllAction(); @@ -698,10 +699,11 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule, { StartAllAction(); + GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); + SwPaM* pCrsr = GetCrsr(); if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ? { - GetDoc()->StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); for( USHORT n = 0; n < aRangeArr.Count(); ++n ) @@ -715,21 +717,17 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule, // <-- GetDoc()->SetCounted( aPam, true ); } - GetDoc()->EndUndo( UNDO_END, NULL ); } else { - GetDoc()->StartUndo( UNDO_START, NULL ); - // --> OD 2008-02-08 #newlistlevelattrs# // --> OD 2008-03-17 #refactorlists# GetDoc()->SetNumRule( *pCrsr, rRule, bCreateNewList, sContinuedListId, sal_True, bResetIndentAttrs ); GetDoc()->SetCounted( *pCrsr, true ); - - GetDoc()->EndUndo( UNDO_END, NULL ); } + GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); EndAllAction(); } @@ -761,12 +759,12 @@ void SwEditShell::SetNumRuleStart( BOOL bFlag ) SwPaM* pCrsr = GetCrsr(); if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ? { - GetDoc()->StartUndo( UNDO_START, NULL ); + GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); for( USHORT n = 0; n < aRangeArr.Count(); ++n ) GetDoc()->SetNumRuleStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), bFlag ); - GetDoc()->EndUndo( UNDO_END, NULL ); + GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } else GetDoc()->SetNumRuleStart( *pCrsr->GetPoint(), bFlag ); @@ -790,12 +788,12 @@ void SwEditShell::SetNodeNumStart( USHORT nStt ) SwPaM* pCrsr = GetCrsr(); if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ? { - GetDoc()->StartUndo( UNDO_START, NULL ); + GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); SwPamRanges aRangeArr( *pCrsr ); SwPaM aPam( *pCrsr->GetPoint() ); for( USHORT n = 0; n < aRangeArr.Count(); ++n ) GetDoc()->SetNodeNumStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), nStt ); - GetDoc()->EndUndo( UNDO_END, NULL ); + GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } else GetDoc()->SetNodeNumStart( *pCrsr->GetPoint(), nStt ); |