sw/inc/frmfmt.hxx | 13 +++++++++++++ sw/source/core/draw/dcontact.cxx | 11 +++++++++++ sw/source/core/layout/atrfrm.cxx | 8 ++++++-- 3 files changed, 30 insertions(+), 2 deletions(-)
New commits: commit c697aa80f4f0f5d86bb84dfe4d64d19f803bc990 Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Thu Dec 1 00:53:02 2016 +0100 use proper message passing Change-Id: I55ce4f6a9b033dc064beed8e70d35a5b5097846d Reviewed-on: https://gerrit.libreoffice.org/31451 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 22db10b..66511d0 100644 --- a/sw/inc/frmfmt.hxx +++ b/sw/inc/frmfmt.hxx @@ -234,6 +234,19 @@ public: //The DrawFrame-Format +namespace sw +{ + enum class DrawFrameFormatHintId { + DYING + }; + struct SW_DLLPUBLIC DrawFrameFormatHint final: SfxHint + { + DrawFrameFormatHintId m_eId; + DrawFrameFormatHint(DrawFrameFormatHintId eId) : m_eId(eId) {}; + virtual ~DrawFrameFormatHint() override; + }; +} + class SW_DLLPUBLIC SwDrawFrameFormat: public SwFrameFormat { friend class SwDoc; diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 94476aa..a80517e 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1529,6 +1529,17 @@ void SwDrawContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint) // #i51474# GetAnchoredObj(nullptr)->ResetLayoutProcessBools(); } + else if (auto pDrawFrameFormatHint = dynamic_cast<const sw::DrawFrameFormatHint*>(&rHint)) + { + switch(pDrawFrameFormatHint->m_eId) + { + case sw::DrawFrameFormatHintId::DYING: + delete this; + break; + default: + SAL_WARN("sw.core", "unhandled DrawFrameFormatHintId"); + } + } } // #i26791# diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 1a9168d..aaccfa7 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -3326,10 +3326,14 @@ SwHandleAnchorNodeChg::~SwHandleAnchorNodeChg() IMPL_FIXEDMEMPOOL_NEWDEL( SwDrawFrameFormat ) +namespace sw +{ + DrawFrameFormatHint::~DrawFrameFormatHint() {} +} + SwDrawFrameFormat::~SwDrawFrameFormat() { - SwContact *pContact = FindContactObj(); - delete pContact; + CallSwClientNotify(sw::DrawFrameFormatHint(sw::DrawFrameFormatHintId::DYING)); } void SwDrawFrameFormat::MakeFrames()
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits