summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/drawview.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/view/drawview.cxx')
-rw-r--r--sd/source/ui/view/drawview.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index ff7f3c4cc488..0d7839ffd862 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -588,6 +588,13 @@ void DrawView::DeleteMarked()
Rectangle aRect( pObj->GetLogicRect() );
SdrObject* pNewObj = pPage->InsertAutoLayoutShape( 0, ePresObjKind, bVertical, aRect, true );
+ // Move the new PresObj to the position before the
+ // object it will replace.
+ pUndoManager->AddUndoAction(
+ mpDoc->GetSdrUndoFactory().CreateUndoObjectOrdNum(
+ *pNewObj,
+ pNewObj->GetOrdNum(),
+ pObj->GetOrdNum()));
pPage->SetObjectOrdNum( pNewObj->GetOrdNum(), pObj->GetOrdNum() );
bResetLayout = true;