sw/source/uibase/docvw/edtwin.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
New commits: commit d57ecadbbbced5ecebe6ede0ef8034d3dc3adae7 Author: Jim Raykowski <rayk...@gmail.com> AuthorDate: Sun Sep 26 16:54:20 2021 -0800 Commit: Jim Raykowski <rayk...@gmail.com> CommitDate: Tue Sep 28 02:13:04 2021 +0200 Outline folding: Check saved outline frame is valid Fixes crash when saved outline frame is no longer an outline node frame. This happens when the mouse pointer is on an outline node text frame and the outline paragraph gets merged with another paragraph. Change-Id: I30902bb51c938844e64169a04a62a79793ac2181 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122669 Tested-by: Jenkins Reviewed-by: Jim Raykowski <rayk...@gmail.com> diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index e93158eb17ba..b75ddcc2a553 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -3916,11 +3916,15 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) else if (m_pSavedOutlineFrame && !m_pSavedOutlineFrame->IsInDtor()) { // current pointer pos is not over an outline frame - // previous frame was an outline frame + // previous pointer pos was over an outline frame // remove outline content visibility button if showing - if (rNds.GetOutLineNds().Seek_Entry(static_cast<SwTextFrame*>(m_pSavedOutlineFrame)->GetTextNodeFirst(), &nPos) && - rSh.GetAttrOutlineContentVisible(nPos)) - GetFrameControlsManager().RemoveControlsByType(FrameControlType::Outline, m_pSavedOutlineFrame); + if (m_pSavedOutlineFrame->isFrameAreaDefinitionValid() && + m_pSavedOutlineFrame->IsTextFrame() && + rNds.GetOutLineNds().Seek_Entry( + static_cast<SwTextFrame*>(m_pSavedOutlineFrame)->GetTextNodeFirst(), &nPos) + && rSh.GetAttrOutlineContentVisible(nPos)) + GetFrameControlsManager().RemoveControlsByType(FrameControlType::Outline, + m_pSavedOutlineFrame); m_pSavedOutlineFrame = nullptr; } }