summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-12-05 21:40:04 +0100
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2016-12-07 13:55:58 +0000
commit48a6d928e66e6a6017002670720b25d34b14167f (patch)
treeefb934b6108c0a48463a5252c6ac5d5f9f4da7c2 /sw
parentaa91c69b9bcd9481e263c63afd66afcda0577b6b (diff)
use proper message passing
Change-Id: I0e8b9cecec0799512b8c5b391de3bc2fcf7655e6 Reviewed-on: https://gerrit.libreoffice.org/31655 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/frmfmt.hxx5
-rw-r--r--sw/source/core/draw/dcontact.cxx5
-rw-r--r--sw/source/core/undo/undraw.cxx11
3 files changed, 11 insertions, 10 deletions
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 6c5b3c3dad3e..0d3cac0f8f3c 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 2a4d4147329a..8e4ebb50de86 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 4c994ec1de17..f17600fc2347 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 );