summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-12-01 00:53:02 +0100
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2016-12-04 08:58:28 +0000
commitc697aa80f4f0f5d86bb84dfe4d64d19f803bc990 (patch)
tree80faa19d9f8f5ffc061e8c8a227c37d3391ea105 /sw
parent17773e1a8dd6e97f57db111819338c418f819cef (diff)
use proper message passing
Change-Id: I55ce4f6a9b033dc064beed8e70d35a5b5097846d Reviewed-on: https://gerrit.libreoffice.org/31451 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.hxx13
-rw-r--r--sw/source/core/draw/dcontact.cxx11
-rw-r--r--sw/source/core/layout/atrfrm.cxx8
3 files changed, 30 insertions, 2 deletions
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 22db10be7030..66511d0e805e 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 94476aab39c2..a80517e84932 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 1a9168d257ee..aaccfa754118 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()