summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-02-21 02:21:47 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-02-22 05:52:27 +0100
commit9f2acf24bf5b7d3c7f4482d0d63d9a7ad9d5481d (patch)
treeaedaa6085263db7188294fc1f226a1c9d269742f /chart2
parent66b16aec3dc8f48f37179b8f5bc5ceaad0e0beb0 (diff)
we know the size so pre alloc the sequence
Change-Id: Icd85ede4898a62833792c68b3e42ad7afa246787
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/charttypes/BarChart.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx
index 5c57ecf25c63..941257b3c401 100644
--- a/chart2/source/view/charttypes/BarChart.cxx
+++ b/chart2/source/view/charttypes/BarChart.cxx
@@ -773,7 +773,15 @@ void BarChart::createShapes()
}
else //m_nDimension!=3
{
+ // performance improvement: alloc the sequence before the rendering
+ // otherwise we have 2 realloc calls
drawing::PolyPolygonShape3D aPoly;
+ aPoly.SequenceX.realloc(1);
+ aPoly.SequenceY.realloc(1);
+ aPoly.SequenceZ.realloc(1);
+ aPoly.SequenceX[0].realloc(5);
+ aPoly.SequenceY[0].realloc(5);
+ aPoly.SequenceZ[0].realloc(5);
drawing::Position3D aLeftUpperPoint( fLogicX-fLogicBarWidth/2.0,fUpperYValue,fLogicZ );
drawing::Position3D aRightUpperPoint( fLogicX+fLogicBarWidth/2.0,fUpperYValue,fLogicZ );