diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-04-04 12:22:06 +0100 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2019-04-08 11:53:31 +0200 |
commit | 709fc73b2c538f0c15d8c94ffeb5d8234a00a01d (patch) | |
tree | 716bfdbb4b9313502060a20f2fc12936012bc175 /svx | |
parent | c6079b5abbd9117e9b01046f2370666e74acab23 (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/70253
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdundo.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 107bd1a0ad05..3cd1fa98d393 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -708,7 +708,7 @@ void SdrUndoRemoveObj::Redo() { ImplUnmarkObject( pObj ); E3DModifySceneSnapRectUpdater aUpdater(pObj); - pObjList->RemoveObject(nOrdNum); + pObjList->RemoveObject(pObj->GetOrdNum()); } // Trigger PageChangeCall @@ -730,7 +730,7 @@ void SdrUndoInsertObj::Undo() { ImplUnmarkObject( pObj ); - SdrObject* pChkObj= pObjList->RemoveObject(nOrdNum); + SdrObject* pChkObj= pObjList->RemoveObject(pObj->GetOrdNum()); DBG_ASSERT(pChkObj==pObj,"UndoInsertObj: RemoveObjNum!=pObj"); } } @@ -886,7 +886,7 @@ void SdrUndoReplaceObj::Undo() SetNewOwner(true); ImplUnmarkObject( pNewObj ); - pObjList->ReplaceObject(pObj,nOrdNum); + pObjList->ReplaceObject(pObj,pNewObj->GetOrdNum()); } else { @@ -904,7 +904,7 @@ void SdrUndoReplaceObj::Redo() SetNewOwner(false); ImplUnmarkObject( pObj ); - pObjList->ReplaceObject(pNewObj,nOrdNum); + pObjList->ReplaceObject(pNewObj,pObj->GetOrdNum()); } else |