summaryrefslogtreecommitdiff
path: root/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-02-28 10:32:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-02-28 11:00:05 +0100
commit3e23161baf5a529d1006b320e9044e436827c764 (patch)
tree467d3421d9e343a3e5ae83711999826817339725 /chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
parent6849b3a1593f56790ad22a050d60ec15333ce9af (diff)
use SfxItemSet::GetItemIfSet in chart2
Change-Id: I1e5eeb8b29d2139a9c3e72c645bae9a8fb5dffff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130664 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx')
-rw-r--r--chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
index 12cb196592d5..04b8769a1fde 100644
--- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
@@ -108,10 +108,9 @@ uno::Reference< beans::XPropertySet > lcl_getEquationProperties(
// ensure that a trendline is on
if( pItemSet )
{
- const SfxPoolItem *pPoolItem = nullptr;
- if( pItemSet->GetItemState( SCHATTR_REGRESSION_TYPE, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SvxChartRegressItem* pRegressionItem = pItemSet->GetItemIfSet( SCHATTR_REGRESSION_TYPE ) )
{
- SvxChartRegress eRegress = static_cast< const SvxChartRegressItem * >( pPoolItem )->GetValue();
+ SvxChartRegress eRegress = pRegressionItem->GetValue();
bEquationExists = ( eRegress != SvxChartRegress::NONE );
}
}
@@ -138,10 +137,9 @@ uno::Reference< beans::XPropertySet > lcl_getCurveProperties(
// ensure that a trendline is on
if( pItemSet )
{
- const SfxPoolItem *pPoolItem = nullptr;
- if( pItemSet->GetItemState( SCHATTR_REGRESSION_TYPE, true, &pPoolItem ) == SfxItemState::SET )
+ if( const SvxChartRegressItem* pRegressionItem = pItemSet->GetItemIfSet( SCHATTR_REGRESSION_TYPE ) )
{
- SvxChartRegress eRegress = static_cast< const SvxChartRegressItem * >( pPoolItem )->GetValue();
+ SvxChartRegress eRegress = pRegressionItem->GetValue();
bExists = ( eRegress != SvxChartRegress::NONE );
}
}