summaryrefslogtreecommitdiff
path: root/chart2/source/view/main
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-01-24 18:44:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-25 06:54:44 +0100
commit1b728994b89b1518137a538f57ee3d7e6644d8da (patch)
treed6a10c78fea5fdd6abd07f5c083b27d827a60429 /chart2/source/view/main
parentbf691e4598ae51b534d004ce21f839081dcd3df9 (diff)
use more concrete types in chart2, ChartType
Change-Id: Ia3d49d53548a843301449c0fea97b81ba85e71e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128878 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/view/main')
-rw-r--r--chart2/source/view/main/ChartView.cxx31
1 files changed, 11 insertions, 20 deletions
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 792ebd6fa3cd..d2a6c8ef797d 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -492,25 +492,21 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
TOOLS_WARN_EXCEPTION("chart2", "" );
}
//iterate through all chart types in the current coordinate system
- uno::Sequence< uno::Reference< XChartType > > aChartTypeList( xCooSys->getChartTypes() );
- for( sal_Int32 nT = 0; nT < aChartTypeList.getLength(); ++nT )
+ std::vector< rtl::Reference< ChartType > > aChartTypeList( xCooSys->getChartTypes2() );
+ for( sal_Int32 nT = 0; nT < static_cast<sal_Int32>(aChartTypeList.size()); ++nT )
{
- uno::Reference< XChartType > xChartType( aChartTypeList[nT] );
+ rtl::Reference< ChartType > xChartType( aChartTypeList[nT] );
if(nDimensionCount == 3 && xChartType->getChartType().equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_PIE))
{
- uno::Reference< beans::XPropertySet > xPropertySet( xChartType, uno::UNO_QUERY );
- if (xPropertySet.is())
+ try
{
- try
- {
- sal_Int32 n3DRelativeHeightOldValue(100);
- uno::Any aAny = xPropertySet->getPropertyValue( "3DRelativeHeight" );
- aAny >>= n3DRelativeHeightOldValue;
- if (n3DRelativeHeightOldValue != n3DRelativeHeight)
- xPropertySet->setPropertyValue( "3DRelativeHeight", uno::Any(n3DRelativeHeight) );
- }
- catch (const uno::Exception&) { }
+ sal_Int32 n3DRelativeHeightOldValue(100);
+ uno::Any aAny = xChartType->getPropertyValue( "3DRelativeHeight" );
+ aAny >>= n3DRelativeHeightOldValue;
+ if (n3DRelativeHeightOldValue != n3DRelativeHeight)
+ xChartType->setPropertyValue( "3DRelativeHeight", uno::Any(n3DRelativeHeight) );
}
+ catch (const uno::Exception&) { }
}
if(nT==0)
@@ -531,15 +527,10 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
if(pVCooSys)
pVCooSys->addMinimumAndMaximumSupplier(pPlotter);
- uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
- OSL_ASSERT( xDataSeriesContainer.is());
- if( !xDataSeriesContainer.is() )
- continue;
-
sal_Int32 zSlot=-1;
sal_Int32 xSlot=-1;
sal_Int32 ySlot=-1;
- uno::Sequence< uno::Reference< XDataSeries > > aSeriesList( xDataSeriesContainer->getDataSeries() );
+ uno::Sequence< uno::Reference< XDataSeries > > aSeriesList( xChartType->getDataSeries() );
for( sal_Int32 nS = 0; nS < aSeriesList.getLength(); ++nS )
{
uno::Reference< XDataSeries > const & xDataSeries = aSeriesList[nS];