diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-02-04 20:14:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-05 17:37:01 +0100 |
commit | f7016b59dd21e3444d9e6802e2a9d254c4684b83 (patch) | |
tree | 009d03fadb954e66d3bea35df52e8320bc4479b8 /chart2/source/tools/StatisticsHelper.cxx | |
parent | 3e895e3d766fd680b96eb0c8d069b7a329f7fd45 (diff) |
use more concrete types in chart2, LabeledDataSequence
Change-Id: I50b23923c1aa946f2c448534719a6c18003592a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129521
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, 12 insertions, 11 deletions
diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx index c8fad963deab..ac748c1901c4 100644 --- a/chart2/source/tools/StatisticsHelper.cxx +++ b/chart2/source/tools/StatisticsHelper.cxx @@ -21,6 +21,7 @@ #include <DataSeriesHelper.hxx> #include <ErrorBar.hxx> #include <unonames.hxx> +#include <LabeledDataSequence.hxx> #include <rtl/ustrbuf.hxx> #include <comphelper/processfactory.hxx> @@ -69,7 +70,7 @@ double lcl_getVariance( const Sequence< double > & rData, sal_Int32 & rOutValidC return (fQuadSum - fSum*fSum/fN) / fN; } -Reference< chart2::data::XLabeledDataSequence > lcl_getErrorBarLabeledSequence( +rtl::Reference< ::chart::LabeledDataSequence > lcl_getErrorBarLabeledSequence( const Reference< chart2::data::XDataSource > & xDataSource, bool bPositiveValue, bool bYError, OUString & rOutRoleNameUsed ) @@ -90,14 +91,14 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getErrorBarLabeledSequence( aRole.append( "negative" ); OUString aLongRole = aRole.makeStringAndClear(); - Reference< chart2::data::XLabeledDataSequence > xLSeq( - ::chart::DataSeriesHelper::getDataSequenceByRole( xDataSource, aLongRole )); + rtl::Reference< ::chart::LabeledDataSequence > xLSeq = + ::chart::DataSeriesHelper::getDataSequenceByRole( xDataSource, aLongRole ); // try role without "-negative" or "-positive" postfix if( xLSeq.is()) rOutRoleNameUsed = aLongRole; else { - xLSeq.set( ::chart::DataSeriesHelper::getDataSequenceByRole( xDataSource, aPlainRole )); + xLSeq = ::chart::DataSeriesHelper::getDataSequenceByRole( xDataSource, aPlainRole ); if( xLSeq.is()) rOutRoleNameUsed = aPlainRole; else @@ -188,20 +189,20 @@ double StatisticsHelper::getStandardError( const Sequence< double > & rData ) return sqrt( fVar ) / sqrt( double(nValCount) ); } -Reference< chart2::data::XLabeledDataSequence > StatisticsHelper::getErrorLabeledDataSequenceFromDataSource( +rtl::Reference< LabeledDataSequence > StatisticsHelper::getErrorLabeledDataSequenceFromDataSource( const Reference< chart2::data::XDataSource > & xDataSource, bool bPositiveValue, bool bYError /* = true */ ) { - Reference< chart2::data::XLabeledDataSequence > xResult; + rtl::Reference< LabeledDataSequence > xResult; if( !xDataSource.is()) return xResult; OUString aRole; - Reference< chart2::data::XLabeledDataSequence > xLSeq( - lcl_getErrorBarLabeledSequence( xDataSource, bPositiveValue, bYError, aRole )); + rtl::Reference< LabeledDataSequence > xLSeq = + lcl_getErrorBarLabeledSequence( xDataSource, bPositiveValue, bYError, aRole ); if( xLSeq.is()) - xResult.set( xLSeq ); + xResult = xLSeq; return xResult; } @@ -211,10 +212,10 @@ Reference< chart2::data::XDataSequence > StatisticsHelper::getErrorDataSequenceF bool bPositiveValue, bool bYError /* = true */ ) { - Reference< chart2::data::XLabeledDataSequence > xLSeq( + rtl::Reference< LabeledDataSequence > xLSeq = StatisticsHelper::getErrorLabeledDataSequenceFromDataSource( xDataSource, bPositiveValue, - bYError )); + bYError ); if( !xLSeq.is()) return Reference< chart2::data::XDataSequence >(); |