sw/source/uibase/utlui/content.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit a46e768810e82abaf98e5cef02c697c718877974 Author: Jim Raykowski <rayk...@gmail.com> AuthorDate: Thu Jan 23 12:32:36 2020 -0900 Commit: Jim Raykowski <rayk...@gmail.com> CommitDate: Sat Jan 25 03:42:52 2020 +0100 tdf#130155 Writer Navigator crash fix: Check entry to expand has children Fixes crash/freeze when an entry without children is sent is to SwContentTree::Expand. It forwards to SvTreeListBox::Expand deal with it. Change-Id: Icd3cd1b2d0a949e01a3e02a6fa4cdc08610c8ffb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87307 Tested-by: Jenkins Reviewed-by: Jim Raykowski <rayk...@gmail.com> diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 21c3d1e6ff07..10fffd48c902 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1515,6 +1515,9 @@ SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt) bool SwContentTree::Expand( SvTreeListEntry* pParent ) { + if (!(pParent->HasChildren() || pParent->HasChildrenOnDemand())) + return SvTreeListBox::Expand(pParent); + if (!m_bIsRoot || (lcl_IsContentType(pParent) && static_cast<SwContentType*>(pParent->GetUserData())->GetType() == ContentTypeId::OUTLINE) || (m_nRootType == ContentTypeId::OUTLINE)) @@ -1559,9 +1562,10 @@ bool SwContentTree::Expand( SvTreeListEntry* pParent ) } } - else if( lcl_IsContent(pParent) ) + else if( lcl_IsContent(pParent) && static_cast<SwContentType*>(pParent->GetUserData())->GetType() == ContentTypeId::OUTLINE) { SwWrtShell* pShell = GetWrtShell(); + // paranoid assert now that outline type is checked assert(dynamic_cast<SwOutlineContent*>(static_cast<SwTypeNumber*>(pParent->GetUserData()))); auto const nPos = static_cast<SwOutlineContent*>(pParent->GetUserData())->GetOutlinePos(); void* key = static_cast<void*>(pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos )); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits