summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-08-16 14:45:26 +0200
committerMichael Stahl <mstahl@redhat.com>2012-08-16 15:14:58 +0200
commitbd00fd98c66e3a19aeea30a4ecef0873da54d5bf (patch)
treea620b086104a1b31884289f4bd0141ad1f599f54 /svx/source
parent3c4fd9de6270948a3f215ae7da23d7f30c1d76da (diff)
_SdrItemBrowserControl::SetAttributes: fix previous commit:
Since the element is no longer removed in the loop the same element is deleted over and over; also the erase should be from nEntryNum to end. Change-Id: I5767d5e453b5b9b05fe1869ab8915f23c30aab14
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/svdraw/svdibrow.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index f76e4231695b..ecc11a961ef1 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -1043,11 +1043,11 @@ void _SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItem
} // while
if (aList.size()>nEntryNum) { // maybe still too many entries
- sal_uIntPtr nTooMuch=aList.size()-nEntryNum;
- for (sal_uIntPtr nNum=0; nNum<nTooMuch; nNum++) {
- delete ImpGetEntry(nEntryNum);
+ size_t const nTooMuch = aList.size() - nEntryNum;
+ for (size_t n = nEntryNum; n < aList.size(); ++n) {
+ delete aList[n];
}
- aList.erase(aList.begin(), aList.begin() + nTooMuch);
+ aList.erase(aList.begin() + nEntryNum, aList.end());
RowRemoved(nEntryNum,nTooMuch);
}
} else {