summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-04-25 11:55:09 +0200
committerMichael Stahl <mstahl@redhat.com>2012-04-25 12:35:34 +0200
commit96938bd075ae9a59557d49d7f9b957da69767567 (patch)
treeaa74fe4ec7d7d94f40f1ade6521d9de3d458557d /sw
parent2ebfe6fd314dd219183b611e27a48a12e3e5f223 (diff)
fix previous commit:
boost::ptr_vector::erase() will delete the element, but fortunately there is a transfer() method that can be used here.
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/cctrl/swlbox.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/sw/source/ui/cctrl/swlbox.cxx b/sw/source/ui/cctrl/swlbox.cxx
index 8139929aba31..045fb1e78fc1 100644
--- a/sw/source/ui/cctrl/swlbox.cxx
+++ b/sw/source/ui/cctrl/swlbox.cxx
@@ -90,15 +90,19 @@ void SwComboBox::RemoveEntry(sal_uInt16 nPos)
// Remove old element
SwBoxEntry* pEntry = &aEntryLst[nPos];
- aEntryLst.erase(aEntryLst.begin() + nPos);
ComboBox::RemoveEntry(nPos);
// Don't add new entries to the list
if(pEntry->bNew)
- return;
-
- // add to DelEntryLst
- aDelEntryLst.push_back(pEntry);
+ {
+ aEntryLst.erase(aEntryLst.begin() + nPos);
+ }
+ else
+ {
+ // add to DelEntryLst
+ aDelEntryLst.transfer(aDelEntryLst.end(),
+ aEntryLst.begin() + nPos, aEntryLst);
+ }
}
sal_uInt16 SwComboBox::GetEntryPos(const SwBoxEntry& rEntry) const