diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-22 09:53:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-22 11:39:19 +0100 |
commit | 06b7f930a51d396bf9e3b6b8d0b3fcbd034730b4 (patch) | |
tree | ece6ceac5b5a3f73d9eb1a2f3dfaf296a57e2eb9 /chart2/source/view/charttypes | |
parent | 9b341bc420f85f06769db13791efab3d115c770b (diff) |
tdf#64914 small improvements
(1) do not read the config inside a hot loop
(2) do not create a SvxShapeGroup only to remove it
Change-Id: I8ff3840d0972d2f617a326a67d18260e44220f56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130331
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/view/charttypes')
-rw-r--r-- | chart2/source/view/charttypes/AreaChart.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx index 9160ad8d93ee..dc5ee63b001d 100644 --- a/chart2/source/view/charttypes/AreaChart.cxx +++ b/chart2/source/view/charttypes/AreaChart.cxx @@ -636,6 +636,8 @@ void AreaChart::createShapes() } } + const bool bUseErrorRectangle = ConfigAccess::getUseErrorRectangle(); + sal_Int32 nZ=1; for( auto const& rZSlot : m_aZSlots ) { @@ -794,12 +796,6 @@ void AreaChart::createShapes() !bCreateXErrorBar && !pSeries->getDataPointLabelIfLabel(nIndex) ) continue; - //create a group shape for this point and add to the series shape: - OUString aPointCID = ObjectIdentifier::createPointCID( - pSeries->getPointCID_Stub(), nIndex ); - rtl::Reference<SvxShapeGroupAnyD> xPointGroupShape_Shapes( - createGroupShape(xSeriesGroupShape_Shapes,aPointCID) ); - { nCreatedPoints++; @@ -809,6 +805,13 @@ void AreaChart::createShapes() { if(m_nDimension!=3) { + //create a group shape for this point and add to the series shape: + OUString aPointCID = ObjectIdentifier::createPointCID( + pSeries->getPointCID_Stub(), nIndex ); + rtl::Reference<SvxShapeGroupAnyD> xPointGroupShape_Shapes; + if (pSymbolProperties->Style == SymbolStyle_STANDARD || pSymbolProperties->Style == SymbolStyle_GRAPHIC) + xPointGroupShape_Shapes = createGroupShape(xSeriesGroupShape_Shapes,aPointCID); + if (pSymbolProperties->Style != SymbolStyle_NONE) { aSymbolSize.DirectionX = pSymbolProperties->Size.Width; @@ -833,7 +836,7 @@ void AreaChart::createShapes() } } //create error bars or rectangles, depending on configuration - if ( ConfigAccess::getUseErrorRectangle() ) + if ( bUseErrorRectangle ) { if ( bCreateXErrorBar || bCreateYErrorBar ) { @@ -917,10 +920,6 @@ void AreaChart::createShapes() , rLogicYSumMap[nAttachedAxisIndex], aScreenPosition2D, eAlignment, nOffset ); } } - - //remove PointGroupShape if empty - if(!xPointGroupShape_Shapes->getCount()) - xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shapes); } }//next series in x slot (next y slot) |