summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2013-06-27 12:07:59 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-06-27 19:07:39 +0000
commit279e329c2d52940c759f40eb59b5f931c4e68b7c (patch)
tree7668d70dcdf0ece48ec532da09dd88b2feccbb4b
parent355289f3c8ae8a7566c11d55162cf5b82ecadbf4 (diff)
fdo#47646 fix undo of ungrouping
(cherry picked from commit 66480d15a04204b0f60008b9cd8e25a66ca6db6a) Change-Id: If20e645d8d708ebe17e2d9455c896c94592993bb Signed-off-by: David Tardon <dtardon@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/4573 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--svx/source/svdraw/svdundo.cxx26
1 files changed, 22 insertions, 4 deletions
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index d5ca5e2a4679..e2111226ef15 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -715,11 +715,29 @@ void SdrUndoObjList::ObjListListener::Notify(SfxBroadcaster&, const SfxHint& rHi
const SdrHint* const pSdrHint(dynamic_cast<const SdrHint*>(&rHint));
if (pSdrHint)
{
- if ((pSdrHint->GetObject() == &m_rObject) && (pSdrHint->GetKind() == HINT_OBJCHG))
+ if (pSdrHint->GetObject() == &m_rObject)
{
- const sal_uInt32 nNewOrdNum(m_rObject.GetOrdNum());
- if (nNewOrdNum != m_rThat.GetOrdNum())
- m_rThat.SetOrdNum(nNewOrdNum);
+ switch (pSdrHint->GetKind())
+ {
+ case HINT_OBJCHG :
+ if (IsListening(*m_pBroadcaster))
+ {
+ const sal_uInt32 nNewOrdNum(m_rObject.GetOrdNum());
+ if (nNewOrdNum != m_rThat.GetOrdNum())
+ m_rThat.SetOrdNum(nNewOrdNum);
+ }
+ break;
+ case HINT_OBJREMOVED :
+ SAL_WARN_IF(!IsListening(*m_pBroadcaster), "svx.sdr", "Object is not in any list");
+ EndListening(*m_pBroadcaster);
+ break;
+ case HINT_OBJINSERTED :
+ SAL_WARN_IF(IsListening(*m_pBroadcaster), "svx.sdr", "Object is already in a list");
+ StartListening(*m_pBroadcaster);
+ break;
+ default :
+ break;
+ }
}
}
}