diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-11-05 13:42:13 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-05 13:44:13 +0000 |
commit | eafd3ee3f01bceef0eb3327be3139a8eee2a2b2e (patch) | |
tree | 028ba773421bb2fe33d9e8e8ce742f75947fce0d | |
parent | 8e2852428dd67cea2f09955f175518cd3563498f (diff) |
tdf#95210 SetHandleControllerPosition is busted wrt HandleFlags::REFX
so instead of saving the initial pos and trying to restore the pos, instead use
a bigger hammer and save the entire geometry and restore that instead.
Change-Id: Id06ea8f205f30771987089c5dc949bb52adc7a27
-rw-r--r-- | cui/source/tabpages/transfrm.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index f6b1f26af278..0db63dbff63f 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -633,10 +633,15 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier(); if (eKind == OBJ_CUSTOMSHAPE) { + //save geometry + SdrCustomShapeGeometryItem aInitialGeometry = + static_cast<const SdrCustomShapeGeometryItem&>(pObj->GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY)); + EnhancedCustomShape2d aShape(pObj); - Point aInitialPosition; + for (int i = 0; i < 2; ++i) { + Point aInitialPosition; if (!aShape.GetHandlePosition(i, aInitialPosition)) break; m_aControlGroups[i]->Enable(); @@ -655,14 +660,10 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) aShape.GetHandlePosition(i, aMinPosition); Rectangle aLogicRect = aShape.GetLogicRect(); + aInitialPosition.Move(-aLogicRect.Left(), -aLogicRect.Top()); aMaxPosition.Move(-aLogicRect.Left(), -aLogicRect.Top()); aMinPosition.Move(-aLogicRect.Left(), -aLogicRect.Top()); - aPosition.X = aInitialPosition.X(); - aPosition.Y = aInitialPosition.Y(); - aInitialPosition.Move(-aLogicRect.Left(), -aLogicRect.Top()); - aShape.SetHandleControllerPosition(i, aPosition); - SetMetricValue(*m_aControlX[i], aInitialPosition.X(), ePoolUnit); SetMetricValue(*m_aControlY[i], aInitialPosition.Y(), ePoolUnit); @@ -681,6 +682,9 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) m_aControlY[i]->SetMax(aMaxPosition.Y(), FUNIT_MM); } } + + //restore geometry + pObj->SetMergedItem(aInitialGeometry); } } for (int i = 0; i < 2; ++i) |