diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-24 16:06:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-24 21:35:00 +0200 |
commit | 73f3028b501c72fb802aa15d0f450afd241e57c6 (patch) | |
tree | a6cef4d3f067a9613d4f44ac58de60861833e8fb /sw | |
parent | 68aec8fd57eda8c05926b7f361dc102772f2c501 (diff) |
ofz#25908 detect if the SwFrameFormat is deleted
Change-Id: Ie9b1587903fef33c5e0471a18e5cbaee1a26f01c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103320
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/basflt/fltshell.cxx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 4f725a98b9a9..ceae383380af 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -962,7 +962,15 @@ SwFltAnchorListener::SwFltAnchorListener(SwFltAnchor* pFltAnchor) void SwFltAnchorListener::Notify(const SfxHint& rHint) { - if(auto pLegacyHint = dynamic_cast<const sw::LegacyModifyHint*>(&rHint)) + if (rHint.GetId() == SfxHintId::Dying) + m_pFltAnchor->SetFrameFormat(nullptr); + else if (auto pDrawFrameFormatHint = dynamic_cast<const sw::DrawFrameFormatHint*>(&rHint)) + { + if (pDrawFrameFormatHint->m_eId != sw::DrawFrameFormatHintId::DYING) + return; + m_pFltAnchor->SetFrameFormat(nullptr); + } + else if (auto pLegacyHint = dynamic_cast<const sw::LegacyModifyHint*>(&rHint)) { if(pLegacyHint->m_pNew->Which() != RES_FMT_CHG) return; @@ -971,12 +979,6 @@ void SwFltAnchorListener::Notify(const SfxHint& rHint) if(pFrameFormat) m_pFltAnchor->SetFrameFormat(pFrameFormat); } - else if (auto pDrawFrameFormatHint = dynamic_cast<const sw::DrawFrameFormatHint*>(&rHint)) - { - if (pDrawFrameFormatHint->m_eId != sw::DrawFrameFormatHintId::DYING) - return; - m_pFltAnchor->SetFrameFormat(nullptr); - } } // methods of SwFltRedline follow |