summaryrefslogtreecommitdiffstats
path: root/chart2/source/model/template
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-03-29 10:34:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-29 19:02:25 +0000
commit99463a6f7f25d53e806fb475a6d5e2ced13b10e6 (patch)
tree85f21f15fa344fe411c904c950b7d65c06fd314b /chart2/source/model/template
parentPrevent accidental OUString(nullptr) (diff)
downloadcore-99463a6f7f25d53e806fb475a6d5e2ced13b10e6.tar.gz
core-99463a6f7f25d53e806fb475a6d5e2ced13b10e6.zip
use more get/setFastPropertyValue in chart2
Change-Id: I1471309e200c8eec21844658b873f817565f9604 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/model/template')
-rw-r--r--chart2/source/model/template/ChartTypeTemplate.cxx8
-rw-r--r--chart2/source/model/template/PieChartTypeTemplate.cxx9
2 files changed, 12 insertions, 5 deletions
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index c99171e5432a..49c93766cd53 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -23,6 +23,7 @@
#include <ChartTypeHelper.hxx>
#include <ChartType.hxx>
#include <DataSeries.hxx>
+#include <DataSeriesProperties.hxx>
#include <DataSource.hxx>
#include <GridProperties.hxx>
@@ -47,6 +48,7 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+using namespace ::chart::DataSeriesProperties;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
@@ -380,7 +382,8 @@ void ChartTypeTemplate::applyStyle2(
lcl_ensureCorrectLabelPlacement( xSeries, aAvailablePlacements );
uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- if( xSeries->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList )
+ // "AttributedDataPoints"
+ if( xSeries->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) >>= aAttributedDataPointIndexList )
for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;)
lcl_ensureCorrectLabelPlacement( xSeries->getDataPointByIndex(aAttributedDataPointIndexList[nN]), aAvailablePlacements );
}
@@ -444,7 +447,8 @@ void ChartTypeTemplate::resetStyles2( const rtl::Reference< ::chart::Diagram >&
lcl_resetLabelPlacementIfDefault( xSeries, nDefaultPlacement );
uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- if( xSeries->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList )
+ // "AttributedDataPoints"
+ if( xSeries->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) >>= aAttributedDataPointIndexList )
for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;)
lcl_resetLabelPlacementIfDefault( xSeries->getDataPointByIndex(aAttributedDataPointIndexList[nN]), nDefaultPlacement );
}
diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx
index 021b3ab6c8f2..88e9ab645f91 100644
--- a/chart2/source/model/template/PieChartTypeTemplate.cxx
+++ b/chart2/source/model/template/PieChartTypeTemplate.cxx
@@ -26,6 +26,7 @@
#include <DiagramHelper.hxx>
#include <DataSeries.hxx>
#include <DataSeriesHelper.hxx>
+#include <DataSeriesProperties.hxx>
#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <ThreeDHelper.hxx>
@@ -41,6 +42,7 @@
#include <algorithm>
using namespace ::com::sun::star;
+using namespace ::chart::DataSeriesProperties;
using ::com::sun::star::beans::Property;
using ::com::sun::star::uno::Sequence;
@@ -305,9 +307,9 @@ bool PieChartTypeTemplate::matchesTemplate2(
rtl::Reference< DataSeries > xSeries( aSeriesVec[nOuterSeriesIndex] );
xSeries->getPropertyValue( "Offset") >>= fOffset;
- //get AttributedDataPoints
+ // "AttributedDataPoints"
uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- if( xSeries->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList )
+ if( xSeries->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) >>= aAttributedDataPointIndexList )
{
for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;)
{
@@ -428,7 +430,8 @@ void PieChartTypeTemplate::applyStyle2(
double fOffsetToSet = fDefaultOffset;
uno::Sequence< sal_Int32 > aAttributedDataPointIndexList;
- xSeries->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList;
+ // "AttributedDataPoints"
+ xSeries->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) >>= aAttributedDataPointIndexList;
// determine whether to set the new offset
bool bSetOffset = ( ePieOffsetMode == chart2::PieChartOffsetMode_ALL_EXPLODED );