Kaydet (Commit) c219d1b9 authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

don't reposition several times in complex hierarchies

We moved the object several times if the object was behind several group
shapes.

Change-Id: I984d6e9208f8924a9968820cf6f95fbb663062b6
üst 92928f99
...@@ -199,6 +199,8 @@ public: ...@@ -199,6 +199,8 @@ public:
*/ */
virtual void render(); virtual void render();
const com::sun::star::awt::Point& getPos(); // internal API
protected: protected:
std::map<OUString, uno::Any> maProperties; std::map<OUString, uno::Any> maProperties;
......
...@@ -182,6 +182,11 @@ awt::Point SAL_CALL DummyXShape::getPosition() ...@@ -182,6 +182,11 @@ awt::Point SAL_CALL DummyXShape::getPosition()
return maPosition; return maPosition;
} }
const awt::Point& DummyXShape::getPos()
{
return maPosition;
}
void SAL_CALL DummyXShape::setPosition( const awt::Point& rPoint ) void SAL_CALL DummyXShape::setPosition( const awt::Point& rPoint )
throw(uno::RuntimeException, std::exception) throw(uno::RuntimeException, std::exception)
{ {
...@@ -1004,8 +1009,8 @@ void SAL_CALL DummyGroup2D::setPosition( const awt::Point& rPos ) ...@@ -1004,8 +1009,8 @@ void SAL_CALL DummyGroup2D::setPosition( const awt::Point& rPos )
for(std::vector<DummyXShape*>::const_iterator itr = maShapes.begin(), for(std::vector<DummyXShape*>::const_iterator itr = maShapes.begin(),
itrEnd = maShapes.end(); itr != itrEnd; ++itr) itrEnd = maShapes.end(); itr != itrEnd; ++itr)
{ {
awt::Point aPos = (*itr)->getPosition(); const awt::Point& rOldPos = (*itr)->getPos();
awt::Point aNewPos( rPos.X + aPos.X, rPos.Y + aPos.Y); awt::Point aNewPos( rPos.X + rOldPos.X, rPos.Y + rOldPos.Y);
(*itr)->setPosition(aNewPos); (*itr)->setPosition(aNewPos);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment