summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-12-09 16:31:30 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2011-12-09 16:34:26 -0500
commit4345b5cb72980dc351147da77505ed06a93028ab (patch)
treec7489ee31a182e25dbd2bce09fc1b566677fc2ce /svx
parent25180de75711cdf10b32a2997a23f201e1dd877f (diff)
fdo#38545: Show/hide anchor when the anchoring status changes.
Setting a page-anchored object to cell-anchored didn't show the anchor immediately until you unselect the object and re-select it. Same for the cell-anchored to page-anchored direction. This commit fixes it.
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/svdhdl.hxx1
-rw-r--r--svx/source/svdraw/svdhdl.cxx20
2 files changed, 21 insertions, 0 deletions
diff --git a/svx/inc/svx/svdhdl.hxx b/svx/inc/svx/svdhdl.hxx
index 895644d47784..f94a00e57acb 100644
--- a/svx/inc/svx/svdhdl.hxx
+++ b/svx/inc/svx/svdhdl.hxx
@@ -502,6 +502,7 @@ public:
// also auf dem Heap stehen, da Clear() ein delete macht.
void AddHdl(SdrHdl* pHdl, sal_Bool bAtBegin=sal_False);
SdrHdl* RemoveHdl(sal_uIntPtr nNum);
+ void RemoveAllByKind(SdrHdlKind eKind);
// Zuletzt eingefuegte Handles werden am ehesten getroffen
// (wenn Handles uebereinander liegen).
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++)