[Libreoffice-commits] .: svtools/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Oct 31 10:28:31 PDT 2012
svtools/source/contnr/treelist.cxx | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
New commits:
commit 8b774b7eb1bb78245214775113830418624bbecf
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 31 17:27:42 2012 +0000
fix crash traversing tools->options with keyboard
Change-Id: Ieba85dd0093c9f704090075d2eb75f1eefdd72de
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
index 2ec20bd..ea451b6 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -1751,9 +1751,14 @@ void SvTreeList::ResortChildren( SvTreeListEntry* pParent )
SvTreeListEntry* p = *it;
sal_uLong nListPos = ULONG_MAX;
GetInsertionPos(p, pParent, nListPos);
- SvTreeListEntries::iterator itPos = pParent->maChildren.begin();
- std::advance(itPos, nListPos);
- pParent->maChildren.insert(itPos, p);
+ if (nListPos < pParent->maChildren.size())
+ {
+ SvTreeListEntries::iterator itPos = pParent->maChildren.begin();
+ std::advance(itPos, nListPos);
+ pParent->maChildren.insert(itPos, p);
+ }
+ else
+ pParent->maChildren.push_back(p);
if (!p->maChildren.empty())
// Recursively sort child entries.
ResortChildren(p);
More information about the Libreoffice-commits
mailing list