From df77dcbbb2ecd3a272a3ea55877a1b1c9fd8ef03 Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Wed, 22 Dec 2021 23:58:09 -0900 Subject: 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 (cherry picked from commit 1609bb6ab5e34fc8fff67240e3c49dde93f2d2d7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127379 Reviewed-by: Xisco Fauli --- sw/source/uibase/docvw/edtwin.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 5fea06590626..0fc6e91b594d 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -3908,10 +3908,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(m_pSavedOutlineFrame)->GetTextNodeFirst(), &nPos) && - rSh.GetAttrOutlineContentVisible(nPos)) - GetFrameControlsManager().RemoveControlsByType(FrameControlType::Outline, m_pSavedOutlineFrame); + if (m_pSavedOutlineFrame && !m_pSavedOutlineFrame->IsInDtor()) + { + SwTextNode* pTextNode = + static_cast(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 -- cgit