summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2021-09-26 16:54:20 -0800
committerJim Raykowski <raykowj@gmail.com>2021-09-28 02:13:04 +0200
commitd57ecadbbbced5ecebe6ede0ef8034d3dc3adae7 (patch)
treed3e365de029e3e320839546654f706a79259af4b
parenteafd23005fb5c3c30701a5f26287541ee3783ccc (diff)
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 <raykowj@gmail.com>
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx12
1 files changed, 8 insertions, 4 deletions
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;
}
}