sw/inc/frmfmt.hxx                |    5 +++--
 sw/source/core/draw/dcontact.cxx |    5 ++++-
 sw/source/core/undo/undraw.cxx   |   11 ++++-------
 3 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 48a6d928e66e6a6017002670720b25d34b14167f
Author: Bjoern Michaelsen <bjoern.michael...@canonical.com>
Date:   Mon Dec 5 21:40:04 2016 +0100

    use proper message passing
    
    Change-Id: I0e8b9cecec0799512b8c5b391de3bc2fcf7655e6
    Reviewed-on: https://gerrit.libreoffice.org/31655
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michael...@canonical.com>

diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 6c5b3c3..0d3cac0 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -259,8 +259,9 @@ namespace sw
     };
     struct SW_DLLPUBLIC ContactChangedHint final: SfxHint
     {
-        SdrObject* m_pObject;
-        ContactChangedHint(SdrObject* pObject) : m_pObject(pObject) {};
+        SdrObject** m_ppObject;
+        ContactChangedHint() : m_ppObject(nullptr) {};
+        ContactChangedHint(SdrObject** ppObject) : m_ppObject(ppObject) {};
         virtual ~ContactChangedHint() override;
     };
 }
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 2a4d414..8e4ebb50 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1520,7 +1520,10 @@ void SwDrawContact::SwClientNotify(const SwModify& rMod, 
const SfxHint& rHint)
     }
     else if (auto pContactChangedHint = dynamic_cast<const 
sw::ContactChangedHint*>(&rHint))
     {
-        Changed(*pContactChangedHint->m_pObject, SdrUserCallType::Delete, 
pContactChangedHint->m_pObject->GetLastBoundRect() );
+        if(!*pContactChangedHint->m_ppObject)
+            *pContactChangedHint->m_ppObject = GetMaster();
+        auto pObject = *pContactChangedHint->m_ppObject;
+        Changed(*pObject, SdrUserCallType::Delete, 
pObject->GetLastBoundRect());
     }
 }
 
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index 4c994ec..f17600f 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -210,13 +210,10 @@ void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &)
 
     // save group object
     SwDrawFrameFormat* pFormat = pObjArr->pFormat;
-    SwDrawContact* pDrawContact = 
static_cast<SwDrawContact*>(pFormat->FindContactObj());
-    SdrObject* pObj = pDrawContact->GetMaster();
-    pObjArr->pObj = pObj;
 
-    // object will destroy itself
-    pDrawContact->Changed( *pObj, SdrUserCallType::Delete, 
pObj->GetLastBoundRect() );
-    pObj->SetUserCall( nullptr );
+    pFormat->CallSwClientNotify(sw::ContactChangedHint(&pObjArr->pObj));
+    auto pObj = pObjArr->pObj;
+    pObj->SetUserCall(nullptr);
 
     ::lcl_SaveAnchor( pFormat, pObjArr->nNodeIdx );
 
@@ -404,7 +401,7 @@ void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &)
 
     // save group object
     SwDrawFrameFormat* pFormat = pObjArr->pFormat;
-    pFormat->CallSwClientNotify(sw::ContactChangedHint(pObjArr->pObj));
+    pFormat->CallSwClientNotify(sw::ContactChangedHint(&(pObjArr->pObj)));
     pObjArr->pObj->SetUserCall( nullptr );
 
     ::lcl_SaveAnchor( pFormat, pObjArr->nNodeIdx );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to