diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-29 10:34:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-29 19:02:25 +0000 |
commit | 99463a6f7f25d53e806fb475a6d5e2ced13b10e6 (patch) | |
tree | 85f21f15fa344fe411c904c950b7d65c06fd314b /chart2/source/tools | |
parent | c6431ba1d041379c37292337337690c01f144fe2 (diff) |
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/tools')
-rw-r--r-- | chart2/source/tools/DataSeriesHelper.cxx | 22 | ||||
-rw-r--r-- | chart2/source/tools/ReferenceSizeProvider.cxx | 8 |
2 files changed, 20 insertions, 10 deletions
diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx index 9935aa0e5fd3..883b72f2908d 100644 --- a/chart2/source/tools/DataSeriesHelper.cxx +++ b/chart2/source/tools/DataSeriesHelper.cxx @@ -19,6 +19,7 @@ #include <DataSeriesHelper.hxx> #include <DataSeries.hxx> +#include <DataSeriesProperties.hxx> #include <DataSource.hxx> #include <ChartType.hxx> #include <unonames.hxx> @@ -49,6 +50,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; +using namespace ::chart::DataSeriesProperties; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; @@ -128,7 +130,8 @@ void lcl_insertOrDeleteDataLabelsToSeriesAndAllPoints( const rtl::Reference< ::c } xSeries->setPropertyValue(CHART_UNONAME_LABEL, uno::Any(aLabelAtSeries)); 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--;) { @@ -486,7 +489,8 @@ void setPropertyAlsoToAllAttributedDataPoints( const rtl::Reference< ::chart::Da xSeries->setPropertyValue( rPropertyName, rPropertyValue ); 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--;) { @@ -500,15 +504,15 @@ void setPropertyAlsoToAllAttributedDataPoints( const rtl::Reference< ::chart::Da } } -bool hasAttributedDataPointDifferentValue( const Reference< chart2::XDataSeries >& xSeries, +bool hasAttributedDataPointDifferentValue( const rtl::Reference< DataSeries >& xSeries, const OUString& rPropertyName, const uno::Any& rPropertyValue ) { - Reference< beans::XPropertySet > xSeriesProperties( xSeries, uno::UNO_QUERY ); - if( !xSeriesProperties.is() ) + if( !xSeries.is() ) return false; uno::Sequence< sal_Int32 > aAttributedDataPointIndexList; - if( xSeriesProperties->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList ) + // "AttributedDataPoints" + if( xSeries->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) >>= aAttributedDataPointIndexList ) { for(sal_Int32 nN=aAttributedDataPointIndexList.getLength();nN--;) { @@ -590,7 +594,8 @@ bool hasDataLabelsAtPoints( const rtl::Reference< DataSeries >& xSeries ) if( xSeries.is() ) { 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--;) { @@ -625,7 +630,8 @@ bool hasDataLabelAtPoint( const rtl::Reference< DataSeries >& xSeries, sal_Int32 if( xSeries.is() ) { uno::Sequence< sal_Int32 > aAttributedDataPointIndexList; - if( xSeries->getPropertyValue( "AttributedDataPoints" ) >>= aAttributedDataPointIndexList ) + // "AttributedDataPoints" + if( xSeries->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) >>= aAttributedDataPointIndexList ) { auto aIt = std::find( std::as_const(aAttributedDataPointIndexList).begin(), std::as_const(aAttributedDataPointIndexList).end(), nPointIndex ); if( aIt != std::as_const(aAttributedDataPointIndexList).end()) diff --git a/chart2/source/tools/ReferenceSizeProvider.cxx b/chart2/source/tools/ReferenceSizeProvider.cxx index e67d4fbe4a57..ad71d4e72641 100644 --- a/chart2/source/tools/ReferenceSizeProvider.cxx +++ b/chart2/source/tools/ReferenceSizeProvider.cxx @@ -22,6 +22,7 @@ #include <ChartModelHelper.hxx> #include <ChartModel.hxx> #include <DataSeries.hxx> +#include <DataSeriesProperties.hxx> #include <DiagramHelper.hxx> #include <Diagram.hxx> #include <Axis.hxx> @@ -32,6 +33,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; +using namespace ::chart::DataSeriesProperties; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; @@ -103,7 +105,8 @@ void ReferenceSizeProvider::setValuesAtAllDataSeries() Sequence< sal_Int32 > aPointIndexes; try { - if( elem->getPropertyValue( "AttributedDataPoints") >>= aPointIndexes ) + // "AttributedDataPoints" + if( elem->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS) >>= aPointIndexes ) { for( sal_Int32 idx : std::as_const(aPointIndexes) ) setValuesAtPropertySet( @@ -265,7 +268,8 @@ ReferenceSizeProvider::AutoResizeState ReferenceSizeProvider::getAutoResizeState Sequence< sal_Int32 > aPointIndexes; try { - if( elem->getPropertyValue( "AttributedDataPoints") >>= aPointIndexes ) + // "AttributedDataPoints" + if( elem->getFastPropertyValue( PROP_DATASERIES_ATTRIBUTED_DATA_POINTS) >>= aPointIndexes ) { for( sal_Int32 idx : std::as_const(aPointIndexes) ) { |