[Libreoffice-commits] core.git: include/svx svx/source

David Tardon dtardon at redhat.com
Thu Jan 29 13:27:04 PST 2015


 include/svx/svdundo.hxx       |    3 -
 svx/source/svdraw/svdundo.cxx |   66 ------------------------------------------
 2 files changed, 69 deletions(-)

New commits:
commit c0117fcb3dbd6c2a8d5e7679ee8d6fb29264ff6b
Author: David Tardon <dtardon at redhat.com>
Date:   Wed Jan 28 09:18:51 2015 +0100

    tdf#78854 do not crash when undoing layout change
    
    It turns out that the ordinal number adjustment that was added for
    fdo#34548 is no longer necessary.
    
    Change-Id: I2c491a008500b6a269b6f05a2a72f5aa70edecb2

diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx
index b99d15e..9d3995f 100644
--- a/include/svx/svdundo.hxx
+++ b/include/svx/svdundo.hxx
@@ -242,9 +242,6 @@ protected:
     SdrView*                    pView;      // To be able to re-create the selection for a
     SdrPageView*                pPageView;  // for a ObjDel, Undo
     sal_uInt32                      nOrdNum;
-    // It's possible that the object is re-assigned during a Undo/Redo.
-    // The object is deleted in the dtor, if bOwner==TRUE
-    ObjListListener*            m_pListener;
 
 protected:
     SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect = false);
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index bde9c51..b901845 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -679,73 +679,11 @@ OUString SdrUndoGeoObj::GetComment() const
 
 
 
-class SdrUndoObjList::ObjListListener : public SfxListener
-{
-public:
-    ObjListListener(SdrUndoObjList& rThat, SdrObject& rObject, SfxBroadcaster& rBroadcaster);
-    virtual ~ObjListListener();
-
-private:
-    virtual void Notify(SfxBroadcaster& rBroadcaster, const SfxHint& rHint) SAL_OVERRIDE;
-
-private:
-    SdrUndoObjList& m_rThat;
-    SdrObject& m_rObject;
-    SfxBroadcaster* m_pBroadcaster;
-};
-
-SdrUndoObjList::ObjListListener::ObjListListener(SdrUndoObjList& rThat, SdrObject& rObject, SfxBroadcaster& rBroadcaster)
-    : m_rThat(rThat)
-    , m_rObject(rObject)
-    , m_pBroadcaster(&rBroadcaster)
-{
-    StartListening(*m_pBroadcaster);
-}
-
-SdrUndoObjList::ObjListListener::~ObjListListener()
-{
-    if (m_pBroadcaster)
-        EndListening(*m_pBroadcaster);
-}
-
-void SdrUndoObjList::ObjListListener::Notify(SfxBroadcaster&, const SfxHint& rHint)
-{
-    const SdrHint* const pSdrHint(dynamic_cast<const SdrHint*>(&rHint));
-    if (pSdrHint)
-    {
-        if (pSdrHint->GetObject() == &m_rObject)
-        {
-            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;
-            }
-        }
-    }
-}
-
 SdrUndoObjList::SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect)
     : SdrUndoObj(rNewObj)
     , bOwner(false)
     , pView(NULL)
     , pPageView(NULL)
-    , m_pListener(NULL)
 {
     pObjList=pObj->GetObjList();
     if (bOrdNumDirect)
@@ -756,16 +694,12 @@ SdrUndoObjList::SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect)
     {
         nOrdNum=pObj->GetOrdNum();
     }
-
-    m_pListener = new ObjListListener(*this, *pObj, *pObj->GetModel());
 }
 
 SdrUndoObjList::~SdrUndoObjList()
 {
     SolarMutexGuard aGuard;
 
-    delete m_pListener;
-
     if (pObj!=NULL && IsOwner())
     {
         // Attribute have to go back to the regular Pool


More information about the Libreoffice-commits mailing list