sw/source/uibase/utlui/content.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit 548e1baac8c767ff51456b5bfeaa98a807fb61f4 Author: Jim Raykowski <rayk...@gmail.com> AuthorDate: Thu Jan 23 12:32:36 2020 -0900 Commit: Xisco Faulí <xiscofa...@libreoffice.org> CommitDate: Tue Jan 28 10:39:43 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> (cherry picked from commit a46e768810e82abaf98e5cef02c697c718877974) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87504 Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org> Tested-by: Xisco Faulí <xiscofa...@libreoffice.org> diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index a5eb88d677a4..c3a71fd0a17b 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1520,6 +1520,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)) @@ -1564,9 +1567,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