diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-12-05 20:43:44 +0100 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2016-12-07 13:55:27 +0000 |
commit | aa91c69b9bcd9481e263c63afd66afcda0577b6b (patch) | |
tree | 044d2aba6ed3e8c55d7b404568ca7f0c07c3eacb /sw | |
parent | ae06f4be6bbdebc10a88c386064d548848e57f80 (diff) |
use proper message passing
Change-Id: If41e50c43f0a4e02faad91f7de18121938f16d0e
Reviewed-on: https://gerrit.libreoffice.org/31654
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.hxx | 6 | ||||
-rw-r--r-- | sw/source/core/draw/dcontact.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 1 | ||||
-rw-r--r-- | sw/source/core/undo/undraw.cxx | 6 |
4 files changed, 12 insertions, 5 deletions
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx index b273f44a319f..6c5b3c3dad3e 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 2dad7eaa258f..2a4d4147329a 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 d199be3f9234..f9944e7fb054 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 1fdb2534d039..4c994ec1de17 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 ); |