diff options
author | Jim Raykowski <raykowj@gmail.com> | 2021-12-22 23:58:09 -0900 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-12-26 21:29:48 +0100 |
commit | 5e019195ee3fdd577b0f333275a49390e010e669 (patch) | |
tree | 7ee19939d73fe7125886779eacff54e997d51bb4 /sw/source/uibase | |
parent | 439814c48b3194398e7abe97a855193dc3e28f12 (diff) |
Outline folding: check pointer before use
Change-Id: Ifa79ef5f286da77fdac9464b4e271021107bf34e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127348
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
(cherry picked from commit 1609bb6ab5e34fc8fff67240e3c49dde93f2d2d7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127378
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 45139e673912..b3bdb09dcff4 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -3893,10 +3893,15 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) SwContentFrame* pContentFrame = aSwContentAtPos.aFnd.pNode->GetTextNode()->getLayoutFrame(nullptr); if (pContentFrame != m_pSavedOutlineFrame) { - if (m_pSavedOutlineFrame && !m_pSavedOutlineFrame->IsInDtor() && - rNds.GetOutLineNds().Seek_Entry(static_cast<SwTextFrame*>(m_pSavedOutlineFrame)->GetTextNodeFirst(), &nPos) && - rSh.GetAttrOutlineContentVisible(nPos)) - GetFrameControlsManager().RemoveControlsByType(FrameControlType::Outline, m_pSavedOutlineFrame); + if (m_pSavedOutlineFrame && !m_pSavedOutlineFrame->IsInDtor()) + { + SwTextNode* pTextNode = + static_cast<SwTextFrame*>(m_pSavedOutlineFrame)->GetTextNodeFirst(); + if (pTextNode && rNds.GetOutLineNds().Seek_Entry(pTextNode, &nPos) && + rSh.GetAttrOutlineContentVisible(nPos)) + GetFrameControlsManager().RemoveControlsByType( + FrameControlType::Outline, m_pSavedOutlineFrame); + } m_pSavedOutlineFrame = pContentFrame; } // show button |