summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-05 13:41:29 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-11-17 17:44:36 +0100
commit9968f6bc25c3ec416a6db863a8d8642ae9a26126 (patch)
treee3191291b6911f79dcebaf05fd74143bcfe4a7cd /sw/source
parent22f4a98bae32dedb0b1c24e9b86876041532168c (diff)
sw: fix crash in SwContentTree::HasContentChanged()
Remove() will remove the node including its children, but SvTreeList::Next() will actually return the first child, so the pChild points to an entry that has been deleted. Change-Id: Ia4bd75d64c8436ea03c0727a8d49ee0c34fda16f (cherry picked from commit cdbe48633f198250e883837dac5d93f93a42888d) Reviewed-on: https://gerrit.libreoffice.org/63427 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/utlui/content.cxx5
1 files changed, 1 insertions, 4 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index b6d5946c9b23..9c6c26c1e47b 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2187,14 +2187,11 @@ bool SwContentTree::HasContentChanged()
}
if(bRemoveChildren)
{
- SvTreeListEntry* pChild = FirstChild(pEntry);
- SvTreeListEntry* pRemove = pChild;
for(size_t j = 0; j < nChildCount; ++j)
{
- pChild = Next(pRemove);
+ SvTreeListEntry *const pRemove = FirstChild(pEntry);
assert(pRemove);
GetModel()->Remove(pRemove);
- pRemove = pChild;
}
}
if(!nChildCount)