diff options
Diffstat (limited to 'sw/source/core/doc/doctxm.cxx')
-rw-r--r-- | sw/source/core/doc/doctxm.cxx | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index d0e1d3b4f158..79fcfc60049d 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -49,6 +49,7 @@ #include <frmatr.hxx> #include <pagedesc.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <pagefrm.hxx> #include <ndtxt.hxx> #include <swtable.hxx> @@ -58,7 +59,7 @@ #include <poolfmt.hxx> #include <txtfrm.hxx> #include <rootfrm.hxx> -#include <undobj.hxx> +#include <UndoAttribute.hxx> #include <swundo.hxx> #include <mdiexp.hxx> #include <docary.hxx> @@ -140,9 +141,8 @@ sal_uInt16 SwDoc::GetTOIKeys( SwTOIKeyType eTyp, SvStringsSort& rArr ) const sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos, SwTOXMarks& rArr ) const { - // suche an der Position rPos nach allen SwTOXMark's - SwTxtNode* pTxtNd = GetNodes()[ rPos.nNode ]->GetTxtNode(); - // kein TextNode oder kein HintsArray vorhanden ?? + // search on Position rPos for all SwTOXMarks + SwTxtNode *const pTxtNd = rPos.nNode.GetNode().GetTxtNode(); if( !pTxtNd || !pTxtNd->GetpSwpHints() ) return 0; @@ -188,14 +188,13 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark ) SwTxtNode& rTxtNd = const_cast<SwTxtNode&>(pTxtTOXMark->GetTxtNode()); ASSERT( rTxtNd.GetpSwpHints(), "kann nicht geloescht werden" ); - if( DoesUndo() ) + if (GetIDocumentUndoRedo().DoesUndo()) { - // fuers Undo die Attribute sichern - ClearRedo(); + // save attributes for Undo SwUndoResetAttr* pUndo = new SwUndoResetAttr( SwPosition( rTxtNd, SwIndex( &rTxtNd, *pTxtTOXMark->GetStart() ) ), RES_TXTATR_TOXMARK ); - AppendUndo( pUndo ); + GetIDocumentUndoRedo().AppendUndo( pUndo ); SwRegHistory aRHst( rTxtNd, &pUndo->GetHistory() ); rTxtNd.GetpSwpHints()->Register( &aRHst ); @@ -203,7 +202,7 @@ void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark ) rTxtNd.DeleteAttribute( const_cast<SwTxtTOXMark*>(pTxtTOXMark) ); - if ( DoesUndo() ) + if (GetIDocumentUndoRedo().DoesUndo()) { if( rTxtNd.GetpSwpHints() ) rTxtNd.GetpSwpHints()->DeRegister(); @@ -364,7 +363,7 @@ const SwTOXBaseSection* SwDoc::InsertTableOf( const SwPosition& rPos, const SfxItemSet* pSet, sal_Bool bExpand ) { - StartUndo( UNDO_INSTOX, NULL ); + GetIDocumentUndoRedo().StartUndo( UNDO_INSTOX, NULL ); String sSectNm( rTOX.GetTOXName() ); sSectNm = GetUniqueTOXBaseName( *rTOX.GetTOXType(), &sSectNm ); @@ -406,7 +405,7 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" )); } } - EndUndo( UNDO_INSTOX, NULL ); + GetIDocumentUndoRedo().EndUndo( UNDO_INSTOX, NULL ); return pNewSection; } @@ -548,7 +547,7 @@ sal_Bool SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes ) SwSectionFmt* pFmt = rTOXSect.GetFmt(); if( pFmt ) { - StartUndo( UNDO_CLEARTOXRANGE, NULL ); + GetIDocumentUndoRedo().StartUndo( UNDO_CLEARTOXRANGE, NULL ); /* Save the start node of the TOX' section. */ SwSectionNode * pMyNode = pFmt->GetSectionNode(); @@ -620,7 +619,7 @@ sal_Bool SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes ) DelSectionFmt( pFmt, bDelNodes ); - EndUndo( UNDO_CLEARTOXRANGE, NULL ); + GetIDocumentUndoRedo().EndUndo( UNDO_CLEARTOXRANGE, NULL ); bRet = sal_True; } |