summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/tblcpy.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/doc/tblcpy.cxx')
-rw-r--r--sw/source/core/doc/tblcpy.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index e19e60e645df..06ca1c814688 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -35,6 +35,7 @@
#include <svl/zforlist.hxx>
#include <frmfmt.hxx>
#include <doc.hxx>
+#include <IDocumentUndoRedo.hxx>
#include <cntfrm.hxx>
#include <pam.hxx>
#include <swtable.hxx>
@@ -47,7 +48,8 @@
#include <mvsave.hxx>
#include <docary.hxx>
#include <fmtanchr.hxx>
-#include <undobj.hxx>
+#include <hints.hxx>
+#include <UndoTable.hxx>
#include <redline.hxx>
#include <fmtfsize.hxx>
#include <list>
@@ -558,9 +560,8 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
if( pUndo )
pUndo->AddBoxBefore( *pDstBox, bDelCntnt );
- BOOL bUndo = pDoc->DoesUndo();
bool bUndoRedline = pUndo && pDoc->IsRedlineOn();
- pDoc->DoUndo( FALSE );
+ ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo());
SwNodeIndex aSavePos( aInsIdx, -1 );
if( pRg.get() )
@@ -628,8 +629,8 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
if( pUndo )
pUndo->AddBoxAfter( *pDstBox, aInsIdx, bDelCntnt );
- // Ueberschrift
- SwTxtNode* pTxtNd = pDoc->GetNodes()[ aSavePos ]->GetTxtNode();
+ // heading
+ SwTxtNode *const pTxtNd = aSavePos.GetNode().GetTxtNode();
if( pTxtNd )
{
USHORT nPoolId = pTxtNd->GetTxtColl()->GetPoolFmtId();
@@ -685,8 +686,6 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
}
}
}
-
- pDoc->DoUndo( bUndo );
}
BOOL SwTable::InsNewTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,