diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-05-09 10:09:24 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-05-09 10:57:12 -0400 |
commit | aa26f8b6c79783447931d01e6c69eed07599f37f (patch) | |
tree | 75d24a8fc5449b65aaa47679e9671afda36ce1a8 | |
parent | 1d188294fd96a82e7200550f8950aa456a481410 (diff) |
No need to store these text objects separately.
Change-Id: I0ee63480fa0f15f42c81818d89ff5b5a3407ece4
-rw-r--r-- | chart2/source/view/charttypes/GL3DBarChart.cxx | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index e65f07e787c0..ce6349ee0a1f 100644 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -55,9 +55,6 @@ void GL3DBarChart::create3DShapes() const float nBarDistanceY = nBarSizeY / 2; sal_uInt32 nId = 1; - - std::vector<opengl3D::Text*> aYAxisTexts; - float nYPos = 0.0; maShapes.clear(); @@ -76,8 +73,8 @@ void GL3DBarChart::create3DShapes() DataSeriesHelper::getDataSeriesLabel( rDataSeries.getModel(), mxChartType->getRoleOfSequenceForSeriesLabel()); - aYAxisTexts.push_back(new opengl3D::Text(mpRenderer.get(), aSeriesName, nId++)); - opengl3D::Text* p = aYAxisTexts.back(); + maShapes.push_back(new opengl3D::Text(mpRenderer.get(), aSeriesName, nId++)); + opengl3D::Text* p = static_cast<opengl3D::Text*>(&maShapes.back()); Size aTextSize = p->getSize(); glm::vec3 aTopLeft, aTopRight, aBottomRight; aTopLeft.x = aTextSize.getWidth() * -1.0; @@ -124,15 +121,6 @@ void GL3DBarChart::create3DShapes() aBottomRight.y += aTextSize.getHeight(); p->setPosition(aTopLeft, aTopRight, aBottomRight); } - - { - // Transfer all Y-axis text objects to the shape collection. - std::vector<opengl3D::Text*>::iterator itText = aYAxisTexts.begin(), itTextEnd = aYAxisTexts.end(); - for (; itText != itTextEnd; ++itText) - maShapes.push_back(*itText); - } - - aYAxisTexts.clear(); } void GL3DBarChart::render() |