diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-03-13 15:58:19 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-03-13 17:01:34 +0100 |
commit | c219d1b932ae223d7241cac9ad8747f3ec70252a (patch) | |
tree | e44135fb7dea4770fd22ce6194e5ad2e03a844f2 /chart2 | |
parent | 92928f99f83f453a00de4f6c41ca0daa7d37f7d4 (diff) |
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
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/inc/DummyXShape.hxx | 2 | ||||
-rw-r--r-- | chart2/source/view/main/DummyXShape.cxx | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx index 60211397212e..cf19ff577dd6 100644 --- a/chart2/source/view/inc/DummyXShape.hxx +++ b/chart2/source/view/inc/DummyXShape.hxx @@ -199,6 +199,8 @@ public: */ virtual void render(); + const com::sun::star::awt::Point& getPos(); // internal API + protected: std::map<OUString, uno::Any> maProperties; diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx index 3d24fcd27a99..39a3553af1b3 100644 --- a/chart2/source/view/main/DummyXShape.cxx +++ b/chart2/source/view/main/DummyXShape.cxx @@ -182,6 +182,11 @@ awt::Point SAL_CALL DummyXShape::getPosition() return maPosition; } +const awt::Point& DummyXShape::getPos() +{ + return maPosition; +} + void SAL_CALL DummyXShape::setPosition( const awt::Point& rPoint ) throw(uno::RuntimeException, std::exception) { @@ -1004,8 +1009,8 @@ void SAL_CALL DummyGroup2D::setPosition( const awt::Point& rPos ) for(std::vector<DummyXShape*>::const_iterator itr = maShapes.begin(), itrEnd = maShapes.end(); itr != itrEnd; ++itr) { - awt::Point aPos = (*itr)->getPosition(); - awt::Point aNewPos( rPos.X + aPos.X, rPos.Y + aPos.Y); + const awt::Point& rOldPos = (*itr)->getPos(); + awt::Point aNewPos( rPos.X + rOldPos.X, rPos.Y + rOldPos.Y); (*itr)->setPosition(aNewPos); } } |