Index: source/unodraw/unopage.cxx =================================================================== RCS file: /cvs/graphics/svx/source/unodraw/unopage.cxx,v retrieving revision 1.40 diff -u -p -r1.40 unopage.cxx --- source/unodraw/unopage.cxx 14 Nov 2006 13:54:12 -0000 1.40 +++ source/unodraw/unopage.cxx 17 May 2007 19:24:07 -0000 @@ -77,6 +77,11 @@ #include "svdopath.hxx" #include "unoapi.hxx" #include "svdomeas.hxx" +#include "svdundo.hxx" +#include "svdglob.hxx" +#include "svdstr.hrc" + + #ifndef _E3D_EXTRUD3D_HXX #include @@ -377,8 +382,8 @@ void SAL_CALL SvxDrawPage::remove( const if( (mpModel == 0) || (mpPage == 0) ) throw lang::DisposedException(); + mpModel->BegUndo( ImpGetResStr( STR_EditDelete ) ); SvxShape* pShape = SvxShape::getImplementation( xShape ); - if(pShape) { SdrObject* pObj = pShape->GetSdrObject(); @@ -390,16 +395,19 @@ void SAL_CALL SvxDrawPage::remove( const { if(mpPage->GetObj(nNum) == pObj) { - delete mpPage->RemoveObject(nNum); + SdrUndoAction * action = mpModel->GetSdrUndoFactory().CreateUndoRemoveObject( *pObj ); + mpModel->AddUndo(action); + + mpPage->RemoveObject(nNum); pShape->InvalidateSdrObject(); break; } } + } } - - if( mpModel ) - mpModel->SetChanged(); + mpModel->SetChanged(); + mpModel->EndUndo(); } // ::com::sun::star::container::XIndexAccess