Kaydet (Commit) 8b774b7e authored tarafından Caolán McNamara's avatar Caolán McNamara

fix crash traversing tools->options with keyboard

Change-Id: Ieba85dd0093c9f704090075d2eb75f1eefdd72de
üst cba921ea
...@@ -1751,9 +1751,14 @@ void SvTreeList::ResortChildren( SvTreeListEntry* pParent ) ...@@ -1751,9 +1751,14 @@ void SvTreeList::ResortChildren( SvTreeListEntry* pParent )
SvTreeListEntry* p = *it; SvTreeListEntry* p = *it;
sal_uLong nListPos = ULONG_MAX; sal_uLong nListPos = ULONG_MAX;
GetInsertionPos(p, pParent, nListPos); GetInsertionPos(p, pParent, nListPos);
SvTreeListEntries::iterator itPos = pParent->maChildren.begin(); if (nListPos < pParent->maChildren.size())
std::advance(itPos, nListPos); {
pParent->maChildren.insert(itPos, p); 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()) if (!p->maChildren.empty())
// Recursively sort child entries. // Recursively sort child entries.
ResortChildren(p); ResortChildren(p);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment