summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-22 10:10:27 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-22 14:24:56 +0100
commit252655333ed773585e12378fa3987bb34f38fa38 (patch)
tree3804aeed09739d125f68058ab4f1ea304d4d1756
parentc5ecf24413625adf9234c67b5da431eb72b3612e (diff)
Resolves: rhbz#1775544 crash in navigator
see demo reproducer in rhbz#1775544 nChildCount is a count of all descendants not just direct children. Just looping while FirstChild returns something is sufficient. Change-Id: If7b16032731d694bfffaae22faad5fe194d1822f Reviewed-on: https://gerrit.libreoffice.org/83454 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/uibase/utlui/content.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index c651a86df0f3..95091161e3fd 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2272,12 +2272,8 @@ bool SwContentTree::HasContentChanged()
}
if(bRemoveChildren)
{
- for(size_t j = 0; j < nChildCount; ++j)
- {
- SvTreeListEntry *const pRemove = FirstChild(pEntry);
- assert(pRemove);
- GetModel()->Remove(pRemove);
- }
+ while (SvTreeListEntry *const pRemove = FirstChild(pEntry))
+ RemoveEntry(pRemove);
}
if(!nChildCount)
{