[Libreoffice-commits] core.git: sw/source
Jim Raykowski (via logerrit)
logerrit at kemper.freedesktop.org
Sat Jan 25 02:43:30 UTC 2020
sw/source/uibase/utlui/content.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit a46e768810e82abaf98e5cef02c697c718877974
Author: Jim Raykowski <raykowj at gmail.com>
AuthorDate: Thu Jan 23 12:32:36 2020 -0900
Commit: Jim Raykowski <raykowj at 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 <raykowj at 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 ));
More information about the Libreoffice-commits
mailing list