summaryrefslogtreecommitdiff
path: root/sw/source/uibase/utlui/content.cxx
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-05 13:41:29 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-11-15 15:09:56 +0100
commit6b001e1895a509edb1294a1fd098c209a5298d69 (patch)
tree9390366c9777aa27e1400e054288a2cb98901f50 /sw/source/uibase/utlui/content.cxx
parentec2e453d39b941a5cf3abcf729a889889976e09d (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
Diffstat (limited to 'sw/source/uibase/utlui/content.cxx')
-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 ae98385adf70..86261677001a 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2202,14 +2202,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)