From 5e019195ee3fdd577b0f333275a49390e010e669 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/+/127378 Reviewed-by: Xisco Fauli --- sw/source/uibase/docvw/edtwin.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'sw/source/uibase') 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(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