summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-04-04 12:22:06 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-04-04 17:21:46 +0200
commitb8c49b1d4d4debd86c4b944b0bb2ba020ef1b030 (patch)
treec8f0873aff75ade197ba65f6ab85824b94af8789 /svx
parent64ee37e4409dbde80bd98fb8d3f65b0146b9cb92 (diff)
Resolves: tdf#120754 on undoing an obj insert use its current ordinal
there may have been changes not caught by undo to the object's ordinal, so on use of RemoveObject (or ReplaceObject) call GetOrdNum on the object to get its current position within its parent. We can keep nOrdNum for the desired dest position within the parent for InsertObject Change-Id: I3bdabf387dd630fc1fadaaa1f3d8c05e93865e4f Reviewed-on: https://gerrit.libreoffice.org/70251 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdundo.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 61b829b95249..300bcdb3a814 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -707,7 +707,7 @@ void SdrUndoRemoveObj::Redo()
{
ImplUnmarkObject( pObj );
E3DModifySceneSnapRectUpdater aUpdater(pObj);
- pObjList->RemoveObject(nOrdNum);
+ pObjList->RemoveObject(pObj->GetOrdNum());
}
// Trigger PageChangeCall
@@ -729,7 +729,7 @@ void SdrUndoInsertObj::Undo()
{
ImplUnmarkObject( pObj );
- SdrObject* pChkObj= pObjList->RemoveObject(nOrdNum);
+ SdrObject* pChkObj= pObjList->RemoveObject(pObj->GetOrdNum());
DBG_ASSERT(pChkObj==pObj,"UndoInsertObj: RemoveObjNum!=pObj");
}
}
@@ -885,7 +885,7 @@ void SdrUndoReplaceObj::Undo()
SetNewOwner(true);
ImplUnmarkObject( pNewObj );
- pObjList->ReplaceObject(pObj,nOrdNum);
+ pObjList->ReplaceObject(pObj,pNewObj->GetOrdNum());
}
else
{
@@ -903,7 +903,7 @@ void SdrUndoReplaceObj::Redo()
SetNewOwner(false);
ImplUnmarkObject( pObj );
- pObjList->ReplaceObject(pNewObj,nOrdNum);
+ pObjList->ReplaceObject(pNewObj,pObj->GetOrdNum());
}
else