[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source
Jim Raykowski (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jan 28 09:40:49 UTC 2020
sw/source/uibase/utlui/content.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 548e1baac8c767ff51456b5bfeaa98a807fb61f4
Author: Jim Raykowski <raykowj at gmail.com>
AuthorDate: Thu Jan 23 12:32:36 2020 -0900
Commit: Xisco Faulí <xiscofauli at 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 <raykowj at gmail.com>
(cherry picked from commit a46e768810e82abaf98e5cef02c697c718877974)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87504
Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
Tested-by: Xisco Faulí <xiscofauli at 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 ));
More information about the Libreoffice-commits
mailing list