diff options
author | David Tardon <dtardon@redhat.com> | 2013-02-13 08:52:52 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-02-13 09:06:23 +0100 |
commit | e462a30d03c16aa4202f8d28ad52b15feb3d9255 (patch) | |
tree | ccbd69ff30cd9f27337323d1c8bb2e4256673370 /svx/source | |
parent | ea264f0c8165eb0c62bf624af5f450b20898469f (diff) |
fdo#34558 don't crash on undoing text frame removal
Change-Id: I48b95c6c0cbfb2f4c4b09cc90b254b96de40b3e9
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/svdraw/svdundo.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 452761dc8b57..5e53ab17c195 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -655,6 +655,8 @@ OUString SdrUndoGeoObj::GetComment() const //////////////////////////////////////////////////////////////////////////////////////////////////// +TYPEINIT1(SdrUndoObjList, SfxListener); + SdrUndoObjList::SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect) : SdrUndoObj(rNewObj), bOwner(sal_False), @@ -667,10 +669,14 @@ SdrUndoObjList::SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect) } else { nOrdNum=pObj->GetOrdNum(); } + + StartListening(*pObjList->GetModel()); } SdrUndoObjList::~SdrUndoObjList() { + EndListening(*pObjList->GetModel()); + if (pObj!=NULL && IsOwner()) { // Attribute have to go back to the regular Pool @@ -686,6 +692,20 @@ void SdrUndoObjList::SetOwner(bool bNew) bOwner = bNew; } +void SdrUndoObjList::Notify(SfxBroadcaster&, const SfxHint& rHint) +{ + const SdrHint* pSdrHint(dynamic_cast<const SdrHint*>(&rHint)); + if (pSdrHint) + { + if ((pSdrHint->GetObject() == pObj) && (pSdrHint->GetKind() == HINT_OBJCHG)) + { + const sal_uInt32 nNewOrdNum(pObj->GetOrdNum()); + if (nNewOrdNum != nOrdNum) + nOrdNum = nNewOrdNum; + } + } +} + //////////////////////////////////////////////////////////////////////////////////////////////////// void SdrUndoRemoveObj::Undo() |