[Libreoffice-commits] core.git: sw/inc sw/source

Bjoern Michaelsen bjoern.michaelsen at canonical.com
Wed Dec 7 13:56:02 UTC 2016


 sw/inc/frmfmt.hxx                |    6 ++++++
 sw/source/core/draw/dcontact.cxx |    4 ++++
 sw/source/core/layout/atrfrm.cxx |    1 +
 sw/source/core/undo/undraw.cxx   |    6 +-----
 4 files changed, 12 insertions(+), 5 deletions(-)

New commits:
commit aa91c69b9bcd9481e263c63afd66afcda0577b6b
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Mon Dec 5 20:43:44 2016 +0100

    use proper message passing
    
    Change-Id: If41e50c43f0a4e02faad91f7de18121938f16d0e
    Reviewed-on: https://gerrit.libreoffice.org/31654
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index b273f44..6c5b3c3 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -257,6 +257,12 @@ namespace sw
         CheckDrawFrameFormatLayerHint(bool* bCheckControlLayer) : m_bCheckControlLayer(bCheckControlLayer) {};
         virtual ~CheckDrawFrameFormatLayerHint() override;
     };
+    struct SW_DLLPUBLIC ContactChangedHint final: SfxHint
+    {
+        SdrObject* m_pObject;
+        ContactChangedHint(SdrObject* pObject) : m_pObject(pObject) {};
+        virtual ~ContactChangedHint() override;
+    };
 }
 
 class SW_DLLPUBLIC SwDrawFrameFormat: public SwFrameFormat
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 2dad7ea..2a4d414 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1518,6 +1518,10 @@ void SwDrawContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
     {
         *(pCheckDrawFrameFormatLayerHint->m_bCheckControlLayer) |= (GetMaster() && CheckControlLayer(GetMaster()));
     }
+    else if (auto pContactChangedHint = dynamic_cast<const sw::ContactChangedHint*>(&rHint))
+    {
+        Changed(*pContactChangedHint->m_pObject, SdrUserCallType::Delete, pContactChangedHint->m_pObject->GetLastBoundRect() );
+    }
 }
 
 // #i26791#
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index d199be3..f9944e7 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -3330,6 +3330,7 @@ namespace sw
 {
     DrawFrameFormatHint::~DrawFrameFormatHint() {}
     CheckDrawFrameFormatLayerHint::~CheckDrawFrameFormatLayerHint() {}
+    ContactChangedHint::~ContactChangedHint() {}
 }
 
 SwDrawFrameFormat::~SwDrawFrameFormat()
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index 1fdb253..4c994ec 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -404,11 +404,7 @@ void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &)
 
     // save group object
     SwDrawFrameFormat* pFormat = pObjArr->pFormat;
-    SwDrawContact* pContact = static_cast<SwDrawContact*>(pFormat->FindContactObj());
-
-        // object will destroy itself
-    pContact->Changed( *pObjArr->pObj, SdrUserCallType::Delete,
-        pObjArr->pObj->GetLastBoundRect() );
+    pFormat->CallSwClientNotify(sw::ContactChangedHint(pObjArr->pObj));
     pObjArr->pObj->SetUserCall( nullptr );
 
     ::lcl_SaveAnchor( pFormat, pObjArr->nNodeIdx );


More information about the Libreoffice-commits mailing list