summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdhdl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/svdraw/svdhdl.cxx')
-rw-r--r--svx/source/svdraw/svdhdl.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 3d2e7868a0b0..5d58e1f85e81 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -2081,6 +2081,26 @@ SdrHdl* SdrHdlList::RemoveHdl(sal_uIntPtr nNum)
return pRetval;
}
+void SdrHdlList::RemoveAllByKind(SdrHdlKind eKind)
+{
+ SdrHdl* p = static_cast<SdrHdl*>(aList.Last());
+ while (p)
+ {
+ if (p->GetKind() == eKind)
+ {
+ // If removing an item doesn't invalidate the current position,
+ // then perhaps it's safe to keep calling Prev here. But then I'm
+ // too lazy to find out & this Container needs to be replaced by
+ // STL anyways... :-P
+ aList.Remove(p);
+ delete p;
+ p = static_cast<SdrHdl*>(aList.Last()); // start from the back again.
+ }
+ else
+ p = static_cast<SdrHdl*>(aList.Prev());
+ }
+}
+
void SdrHdlList::Clear()
{
for (sal_uIntPtr i=0; i<GetHdlCount(); i++)