summaryrefslogtreecommitdiff
path: root/sw/source/uibase/utlui/content.cxx
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 12:49:28 +0100
commit18eb7166d18b6ba91e0bb2415f3709ac5b30416d (patch)
tree4cd61802ec0ee6aee8ed6c442916578959e7cfd3 /sw/source/uibase/utlui/content.cxx
parent00a3fb87878720731264ec2d118675ba9a78e745 (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/83455 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/uibase/utlui/content.cxx')
-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 21b72b3a9bcd..a5eb88d677a4 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2268,12 +2268,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)
{