[Libreoffice-commits] .: svtools/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Oct 30 13:25:38 PDT 2012
svtools/source/contnr/treelist.cxx | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
New commits:
commit 9106fc3aa811002bf66b69951a754daccff98d67
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Oct 30 16:24:18 2012 -0400
Avoiding deleting the removed entry.
The tree list entries are now stored in ptr_vector. We no longer
have to manually call delete on it whenever it gets removed from the
list.
Change-Id: Id183aadbdc3b1565d1c702dc0fc099df9dcb6e2c
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
index 1716e27..f3bf0bc 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -1257,6 +1257,8 @@ bool SvTreeList::Remove( const SvTreeListEntry* pEntry )
SvTreeListEntries& rList = pParent->maChildren;
bool bLastEntry = false;
+ Broadcast(LISTACTION_REMOVED, const_cast<SvTreeListEntry*>(pEntry));
+
if ( pEntry->HasChildListPos() )
{
size_t nListPos = pEntry->GetChildListPos();
@@ -1273,7 +1275,6 @@ bool SvTreeList::Remove( const SvTreeListEntry* pEntry )
rList.erase(it);
}
-
// moved to end of method because it is used later with Broadcast
if (!rList.empty() && !bLastEntry)
@@ -1284,9 +1285,7 @@ bool SvTreeList::Remove( const SvTreeListEntry* pEntry )
#ifdef CHECK_INTEGRITY
CheckIntegrity();
#endif
- Broadcast(LISTACTION_REMOVED, const_cast<SvTreeListEntry*>(pEntry));
- delete pEntry; // deletes any children as well
return true;
}
More information about the Libreoffice-commits
mailing list