diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-22 11:04:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-22 19:58:26 +0000 |
commit | f6da444a9e2b239d8905d6cdb845c7be8d8ce66f (patch) | |
tree | e36e2af7984ab3cccd9b21a1415efeba1dfdee3e /chart2/source/tools/StatisticsHelper.cxx | |
parent | f5b0bd23ff80f5229371c6e289480b347f168524 (diff) |
use more concrete type in chart2
Change-Id: I33deb726da5a59093b1104696da7c80ce830b7e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149335
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/tools/StatisticsHelper.cxx')
-rw-r--r-- | chart2/source/tools/StatisticsHelper.cxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx index 13132856ef23..e97475915705 100644 --- a/chart2/source/tools/StatisticsHelper.cxx +++ b/chart2/source/tools/StatisticsHelper.cxx @@ -18,6 +18,7 @@ */ #include <StatisticsHelper.hxx> +#include <DataSeries.hxx> #include <DataSeriesHelper.hxx> #include <ErrorBar.hxx> #include <unonames.hxx> @@ -281,18 +282,17 @@ void StatisticsHelper::setErrorDataSequence( } Reference< beans::XPropertySet > StatisticsHelper::addErrorBars( - const Reference< chart2::XDataSeries > & xDataSeries, + const rtl::Reference< DataSeries > & xDataSeries, sal_Int32 nStyle, bool bYError /* = true */ ) { Reference< beans::XPropertySet > xErrorBar; - Reference< beans::XPropertySet > xSeriesProp( xDataSeries, uno::UNO_QUERY ); - if( !xSeriesProp.is()) + if( !xDataSeries.is()) return xErrorBar; const OUString aPropName( bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X)); - if( !( xSeriesProp->getPropertyValue( aPropName ) >>= xErrorBar ) || + if( !( xDataSeries->getPropertyValue( aPropName ) >>= xErrorBar ) || !xErrorBar.is()) { xErrorBar.set( new ErrorBar ); @@ -304,28 +304,27 @@ Reference< beans::XPropertySet > StatisticsHelper::addErrorBars( xErrorBar->setPropertyValue( "ErrorBarStyle", uno::Any( nStyle )); } - xSeriesProp->setPropertyValue( aPropName, uno::Any( xErrorBar )); + xDataSeries->setPropertyValue( aPropName, uno::Any( xErrorBar )); return xErrorBar; } Reference< beans::XPropertySet > StatisticsHelper::getErrorBars( - const Reference< chart2::XDataSeries > & xDataSeries, + const rtl::Reference< DataSeries > & xDataSeries, bool bYError /* = true */ ) { - Reference< beans::XPropertySet > xSeriesProp( xDataSeries, uno::UNO_QUERY ); Reference< beans::XPropertySet > xErrorBar; const OUString aPropName( bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X)); - if ( xSeriesProp.is()) - xSeriesProp->getPropertyValue( aPropName ) >>= xErrorBar; + if ( xDataSeries.is()) + xDataSeries->getPropertyValue( aPropName ) >>= xErrorBar; return xErrorBar; } bool StatisticsHelper::hasErrorBars( - const Reference< chart2::XDataSeries > & xDataSeries, + const rtl::Reference< DataSeries > & xDataSeries, bool bYError /* = true */ ) { Reference< beans::XPropertySet > xErrorBar( getErrorBars( xDataSeries, bYError )); @@ -337,7 +336,7 @@ bool StatisticsHelper::hasErrorBars( } void StatisticsHelper::removeErrorBars( - const Reference< chart2::XDataSeries > & xDataSeries, + const rtl::Reference< DataSeries > & xDataSeries, bool bYError /* = true */ ) { Reference< beans::XPropertySet > xErrorBar( getErrorBars( xDataSeries, bYError )); @@ -347,7 +346,7 @@ void StatisticsHelper::removeErrorBars( } bool StatisticsHelper::usesErrorBarRanges( - const Reference< chart2::XDataSeries > & xDataSeries, + const rtl::Reference< DataSeries > & xDataSeries, bool bYError /* = true */ ) { Reference< beans::XPropertySet > xErrorBar( getErrorBars( xDataSeries, bYError )); |