diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-02-05 14:58:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-05 20:39:03 +0100 |
commit | 333ccb081b4ab62adce50ca4c93162b9baf984d0 (patch) | |
tree | 05c9f99d750a549e9d397735ed62687c75df6b50 /chart2/source/model | |
parent | 1a4955f2c1158197db74d7cf4f1f0c98c096224c (diff) |
use more concrete types in chart2, Axis
Change-Id: If80b6487ad2b8ac75f98f798b839aff2b8a5c23e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129522
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/model')
-rw-r--r-- | chart2/source/model/main/Axis.cxx | 2 | ||||
-rw-r--r-- | chart2/source/model/main/Axis.hxx | 133 | ||||
-rw-r--r-- | chart2/source/model/main/BaseCoordinateSystem.cxx | 48 | ||||
-rw-r--r-- | chart2/source/model/main/Diagram.cxx | 22 | ||||
-rw-r--r-- | chart2/source/model/template/BubbleChartType.cxx | 3 | ||||
-rw-r--r-- | chart2/source/model/template/ChartType.cxx | 9 | ||||
-rw-r--r-- | chart2/source/model/template/ChartTypeTemplate.cxx | 35 | ||||
-rw-r--r-- | chart2/source/model/template/NetChartType.cxx | 5 | ||||
-rw-r--r-- | chart2/source/model/template/PieChartType.cxx | 3 | ||||
-rw-r--r-- | chart2/source/model/template/PieChartTypeTemplate.cxx | 5 | ||||
-rw-r--r-- | chart2/source/model/template/ScatterChartType.cxx | 3 |
11 files changed, 103 insertions, 165 deletions
diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx index 9bae79cf8adc..9507f3719088 100644 --- a/chart2/source/model/main/Axis.cxx +++ b/chart2/source/model/main/Axis.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Axis.hxx" +#include <Axis.hxx> #include "GridProperties.hxx" #include <CharacterProperties.hxx> #include <LinePropertiesHelper.hxx> diff --git a/chart2/source/model/main/Axis.hxx b/chart2/source/model/main/Axis.hxx deleted file mode 100644 index b85930a23456..000000000000 --- a/chart2/source/model/main/Axis.hxx +++ /dev/null @@ -1,133 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#pragma once - -#include <OPropertySet.hxx> -#include <cppuhelper/basemutex.hxx> -#include <cppuhelper/implbase.hxx> -#include <comphelper/uno3.hxx> - -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/chart2/XAxis.hpp> -#include <com/sun/star/chart2/XTitled.hpp> -#include <com/sun/star/util/XCloneable.hpp> -#include <ModifyListenerHelper.hxx> - -namespace chart -{ - -namespace impl -{ -typedef ::cppu::WeakImplHelper< - css::chart2::XAxis, - css::chart2::XTitled, - css::lang::XServiceInfo, - css::util::XCloneable, - css::util::XModifyBroadcaster, - css::util::XModifyListener > - Axis_Base; -} - -class Axis final : - public cppu::BaseMutex, - public impl::Axis_Base, - public ::property::OPropertySet -{ -public: - explicit Axis(); - virtual ~Axis() override; - - /// XServiceInfo declarations - virtual OUString SAL_CALL getImplementationName() override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - - /// merge XInterface implementations - DECLARE_XINTERFACE() - /// merge XTypeProvider implementations - DECLARE_XTYPEPROVIDER() - -private: - explicit Axis( const Axis & rOther ); - - // late initialization to call after copy-constructing - void Init(); - - // ____ OPropertySet ____ - virtual void GetDefaultValue( sal_Int32 nHandle, css::uno::Any& rAny ) const override; - - // ____ OPropertySet ____ - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; - - // ____ XPropertySet ____ - virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL - getPropertySetInfo() override; - - // ____ XAxis ____ - virtual void SAL_CALL setScaleData( const css::chart2::ScaleData& rScaleData ) override; - virtual css::chart2::ScaleData SAL_CALL getScaleData() override; - virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getGridProperties() override; - virtual css::uno::Sequence< css::uno::Reference< css::beans::XPropertySet > > SAL_CALL getSubGridProperties() override; - virtual css::uno::Sequence< css::uno::Reference< css::beans::XPropertySet > > SAL_CALL getSubTickProperties() override; - - // ____ XTitled ____ - virtual css::uno::Reference< css::chart2::XTitle > SAL_CALL getTitleObject() override; - virtual void SAL_CALL setTitleObject( - const css::uno::Reference< css::chart2::XTitle >& Title ) override; - - // ____ XCloneable ____ - // Note: the coordinate systems are not cloned! - virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override; - - // ____ XModifyBroadcaster ____ - virtual void SAL_CALL addModifyListener( - const css::uno::Reference< css::util::XModifyListener >& aListener ) override; - virtual void SAL_CALL removeModifyListener( - const css::uno::Reference< css::util::XModifyListener >& aListener ) override; - - // ____ XModifyListener ____ - virtual void SAL_CALL modified( - const css::lang::EventObject& aEvent ) override; - - // ____ XEventListener (base of XModifyListener) ____ - virtual void SAL_CALL disposing( - const css::lang::EventObject& Source ) override; - - // ____ OPropertySet ____ - virtual void firePropertyChangeEvent() override; - using OPropertySet::disposing; - - void fireModifyEvent(); - - void AllocateSubGrids(); - - rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder; - - css::chart2::ScaleData m_aScaleData; - - css::uno::Reference< css::beans::XPropertySet > m_xGrid; - - css::uno::Sequence< css::uno::Reference< css::beans::XPropertySet > > m_aSubGridProperties; - - css::uno::Reference< css::chart2::XTitle > m_xTitle; -}; - -} // namespace chart - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/BaseCoordinateSystem.cxx b/chart2/source/model/main/BaseCoordinateSystem.cxx index bc02bf753561..52ef7ffde0d7 100644 --- a/chart2/source/model/main/BaseCoordinateSystem.cxx +++ b/chart2/source/model/main/BaseCoordinateSystem.cxx @@ -22,7 +22,7 @@ #include <UserDefinedProperties.hxx> #include <CloneHelper.hxx> #include <ModifyListenerHelper.hxx> -#include "Axis.hxx" +#include <Axis.hxx> #include <ChartType.hxx> #include <com/sun/star/chart2/AxisType.hpp> #include <com/sun/star/container/NoSuchElementException.hpp> @@ -125,7 +125,7 @@ BaseCoordinateSystem::BaseCoordinateSystem( for( sal_Int32 nN=0; nN<m_nDimensionCount; nN++ ) { m_aAllAxis[nN].resize( 1 ); - Reference< chart2::XAxis > xAxis( new Axis ); + rtl::Reference< Axis > xAxis( new Axis ); m_aAllAxis[nN][0] = xAxis; ModifyListenerHelper::addListenerToAllElements( m_aAllAxis[nN], m_xModifyEventForwarder ); @@ -159,7 +159,7 @@ BaseCoordinateSystem::BaseCoordinateSystem( m_aAllAxis.resize(rSource.m_aAllAxis.size()); tAxisVecVecType::size_type nN=0; for( nN=0; nN<m_aAllAxis.size(); nN++ ) - CloneHelper::CloneRefVector<chart2::XAxis>( rSource.m_aAllAxis[nN], m_aAllAxis[nN] ); + CloneHelper::CloneRefVector( rSource.m_aAllAxis[nN], m_aAllAxis[nN] ); for (const auto & rxChartType : rSource.m_aChartTypes) m_aChartTypes.push_back(rxChartType->cloneChartType()); @@ -207,7 +207,33 @@ void SAL_CALL BaseCoordinateSystem::setAxisByDimension( m_aAllAxis[ nDimensionIndex ][nIndex] = nullptr; } - Reference< chart2::XAxis > xOldAxis( m_aAllAxis[ nDimensionIndex ][nIndex] ); + rtl::Reference< Axis > xOldAxis( m_aAllAxis[ nDimensionIndex ][nIndex] ); + if( xOldAxis.is()) + ModifyListenerHelper::removeListener( xOldAxis, m_xModifyEventForwarder ); + m_aAllAxis[ nDimensionIndex ][nIndex] = dynamic_cast<Axis*>(xAxis.get()); + if( xAxis.is()) + ModifyListenerHelper::addListener( xAxis, m_xModifyEventForwarder ); + fireModifyEvent(); +} + +void BaseCoordinateSystem::setAxisByDimension( + sal_Int32 nDimensionIndex, + const rtl::Reference< Axis >& xAxis, + sal_Int32 nIndex ) +{ + if( nDimensionIndex < 0 || nDimensionIndex >= getDimension() ) + throw lang::IndexOutOfBoundsException(); + + if( nIndex < 0 ) + throw lang::IndexOutOfBoundsException(); + + if( m_aAllAxis[ nDimensionIndex ].size() < o3tl::make_unsigned( nIndex+1 )) + { + m_aAllAxis[ nDimensionIndex ].resize( nIndex+1 ); + m_aAllAxis[ nDimensionIndex ][nIndex] = nullptr; + } + + rtl::Reference< Axis > xOldAxis( m_aAllAxis[ nDimensionIndex ][nIndex] ); if( xOldAxis.is()) ModifyListenerHelper::removeListener( xOldAxis, m_xModifyEventForwarder ); m_aAllAxis[ nDimensionIndex ][nIndex] = xAxis; @@ -230,6 +256,20 @@ Reference< chart2::XAxis > SAL_CALL BaseCoordinateSystem::getAxisByDimension( return m_aAllAxis[ nDimensionIndex ][nAxisIndex]; } +rtl::Reference< Axis > BaseCoordinateSystem::getAxisByDimension2( + sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const +{ + if( nDimensionIndex < 0 || nDimensionIndex >= m_nDimensionCount ) + throw lang::IndexOutOfBoundsException(); + + OSL_ASSERT( m_aAllAxis.size() == static_cast< size_t >( m_nDimensionCount)); + + if( nAxisIndex < 0 || nAxisIndex > static_cast<sal_Int32>(m_aAllAxis[ nDimensionIndex ].size()) ) + throw lang::IndexOutOfBoundsException(); + + return m_aAllAxis[ nDimensionIndex ][nAxisIndex]; +} + sal_Int32 SAL_CALL BaseCoordinateSystem::getMaximumAxisIndexByDimension( sal_Int32 nDimensionIndex ) { if( nDimensionIndex < 0 || nDimensionIndex >= getDimension() ) diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index 60bcbd5124f7..f160987addc3 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -524,6 +524,28 @@ void SAL_CALL Diagram::setCoordinateSystems( fireModifyEvent(); } +void Diagram::setCoordinateSystems( + const std::vector< rtl::Reference< BaseCoordinateSystem > >& aCoordinateSystems ) +{ + tCoordinateSystemContainerType aNew; + tCoordinateSystemContainerType aOld; + if( !aCoordinateSystems.empty() ) + { + OSL_ENSURE( aCoordinateSystems.size()<=1, "more than one coordinatesystem is not supported yet by the fileformat" ); + aNew.push_back( aCoordinateSystems[0] ); + } + { + MutexGuard aGuard( m_aMutex ); + std::swap( aOld, m_aCoordSystems ); + m_aCoordSystems = aNew; + } + for (auto & xSystem : aOld) + xSystem->removeModifyListener(m_xModifyEventForwarder); + for (auto & xSystem : aNew) + xSystem->addModifyListener(m_xModifyEventForwarder); + fireModifyEvent(); +} + // ____ XCloneable ____ Reference< util::XCloneable > SAL_CALL Diagram::createClone() { diff --git a/chart2/source/model/template/BubbleChartType.cxx b/chart2/source/model/template/BubbleChartType.cxx index c2d7d367ea65..8a23388ab336 100644 --- a/chart2/source/model/template/BubbleChartType.cxx +++ b/chart2/source/model/template/BubbleChartType.cxx @@ -21,6 +21,7 @@ #include <PropertyHelper.hxx> #include <servicenames_charttypes.hxx> #include <CartesianCoordinateSystem.hxx> +#include <Axis.hxx> #include <AxisHelper.hxx> #include <AxisIndexDefines.hxx> #include <com/sun/star/chart2/AxisType.hpp> @@ -123,7 +124,7 @@ Reference< chart2::XCoordinateSystem > SAL_CALL for( sal_Int32 i=0; i<DimensionCount; ++i ) { - Reference< chart2::XAxis > xAxis( xResult->getAxisByDimension( i, MAIN_AXIS_INDEX ) ); + rtl::Reference< Axis > xAxis = xResult->getAxisByDimension2( i, MAIN_AXIS_INDEX ); if( !xAxis.is() ) { OSL_FAIL("a created coordinate system should have an axis for each dimension"); diff --git a/chart2/source/model/template/ChartType.cxx b/chart2/source/model/template/ChartType.cxx index 588b3fa653e9..eff91f9cc9bb 100644 --- a/chart2/source/model/template/ChartType.cxx +++ b/chart2/source/model/template/ChartType.cxx @@ -19,6 +19,7 @@ #include <ChartType.hxx> #include <CartesianCoordinateSystem.hxx> +#include <Axis.hxx> #include <AxisHelper.hxx> #include <CloneHelper.hxx> #include <AxisIndexDefines.hxx> @@ -68,12 +69,18 @@ ChartType::~ChartType() Reference< chart2::XCoordinateSystem > SAL_CALL ChartType::createCoordinateSystem( ::sal_Int32 DimensionCount ) { + return createCoordinateSystem2(DimensionCount); +} + +rtl::Reference< BaseCoordinateSystem > + ChartType::createCoordinateSystem2( ::sal_Int32 DimensionCount ) +{ rtl::Reference< CartesianCoordinateSystem > xResult = new CartesianCoordinateSystem( DimensionCount ); for( sal_Int32 i=0; i<DimensionCount; ++i ) { - Reference< chart2::XAxis > xAxis( xResult->getAxisByDimension( i, MAIN_AXIS_INDEX ) ); + rtl::Reference< Axis > xAxis = xResult->getAxisByDimension2( i, MAIN_AXIS_INDEX ); if( !xAxis.is() ) { OSL_FAIL("a created coordinate system should have an axis for each dimension"); diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx index 902c54ed6a89..df4cb7d17c92 100644 --- a/chart2/source/model/template/ChartTypeTemplate.cxx +++ b/chart2/source/model/template/ChartTypeTemplate.cxx @@ -25,6 +25,7 @@ #include <DataSeries.hxx> #include <DataSource.hxx> +#include <Axis.hxx> #include <AxisHelper.hxx> #include <Diagram.hxx> #include <DiagramHelper.hxx> @@ -420,18 +421,14 @@ void ChartTypeTemplate::resetStyles( const rtl::Reference< ::chart::Diagram >& x bool bPercent = (getStackMode(0) == StackMode::YStackedPercent); if( bPercent ) { - const Sequence< Reference< chart2::XAxis > > aAxisSeq( AxisHelper::getAllAxesOfDiagram( xDiagram ) ); - for( Reference< chart2::XAxis > const & axis : aAxisSeq ) + const std::vector< rtl::Reference< Axis > > aAxisSeq( AxisHelper::getAllAxesOfDiagram( xDiagram ) ); + for( rtl::Reference< Axis > const & axis : aAxisSeq ) { if( AxisHelper::getDimensionIndexOfAxis( axis, xDiagram )== 1 ) { - Reference< beans::XPropertySet > xAxisProp( axis, uno::UNO_QUERY ); - if( xAxisProp.is()) - { - // set number format to source format - xAxisProp->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::Any(true)); - xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any()); - } + // set number format to source format + axis->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::Any(true)); + axis->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any()); } } } @@ -499,7 +496,7 @@ void ChartTypeTemplate::createCoordinateSystems( rtl::Reference< ChartType > xChartType( getChartTypeForNewSeries(aFormerlyUsedChartTypes)); if( ! xChartType.is()) return; - Reference< XCoordinateSystem > xCooSys( xChartType->createCoordinateSystem( getDimension())); + rtl::Reference< BaseCoordinateSystem > xCooSys = ChartType::createCoordinateSystem2( getDimension()); if( ! xCooSys.is()) { // chart type wants no coordinate systems @@ -514,13 +511,13 @@ void ChartTypeTemplate::createCoordinateSystems( AxisHelper::makeGridVisible( xAxis->getGridProperties() ); } - Sequence< Reference< XCoordinateSystem > > aCoordinateSystems( - xDiagram->getCoordinateSystems()); + std::vector< rtl::Reference< BaseCoordinateSystem > > aCoordinateSystems( + xDiagram->getBaseCoordinateSystems()); - if( aCoordinateSystems.hasElements()) + if( !aCoordinateSystems.empty() ) { bool bOk = true; - for( sal_Int32 i=0; bOk && i<aCoordinateSystems.getLength(); ++i ) + for( sal_Int32 i=0; bOk && i<static_cast<sal_Int32>(aCoordinateSystems.size()); ++i ) bOk = bOk && ( xCooSys->getCoordinateSystemType() == aCoordinateSystems[i]->getCoordinateSystemType() && (xCooSys->getDimension() == aCoordinateSystems[i]->getDimension()) ); // coordinate systems are ok @@ -530,9 +527,9 @@ void ChartTypeTemplate::createCoordinateSystems( } //copy as much info from former coordinate system as possible: - if( aCoordinateSystems.hasElements() ) + if( !aCoordinateSystems.empty() ) { - Reference< XCoordinateSystem > xOldCooSys( aCoordinateSystems[0] ); + rtl::Reference< BaseCoordinateSystem > xOldCooSys( aCoordinateSystems[0] ); sal_Int32 nMaxDimensionCount = std::min( xCooSys->getDimension(), xOldCooSys->getDimension() ); for(sal_Int32 nDimensionIndex=0; nDimensionIndex<nMaxDimensionCount; nDimensionIndex++) @@ -540,7 +537,7 @@ void ChartTypeTemplate::createCoordinateSystems( const sal_Int32 nMaximumAxisIndex = xOldCooSys->getMaximumAxisIndexByDimension(nDimensionIndex); for(sal_Int32 nAxisIndex=0; nAxisIndex<=nMaximumAxisIndex; ++nAxisIndex) { - uno::Reference< XAxis > xAxis( xOldCooSys->getAxisByDimension( nDimensionIndex, nAxisIndex ) ); + rtl::Reference< Axis > xAxis = xOldCooSys->getAxisByDimension2( nDimensionIndex, nAxisIndex ); if( xAxis.is()) { xCooSys->setAxisByDimension( nDimensionIndex, xAxis, nAxisIndex ); @@ -573,7 +570,7 @@ void ChartTypeTemplate::adaptScales( const sal_Int32 nMaxIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionX); for(sal_Int32 nI=0; nI<=nMaxIndex; ++nI) { - Reference< XAxis > xAxis( xCooSys->getAxisByDimension(nDimensionX,nI) ); + rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2(nDimensionX,nI); if( xAxis.is()) { ScaleData aData( xAxis->getScaleData() ); @@ -606,7 +603,7 @@ void ChartTypeTemplate::adaptScales( const sal_Int32 nMaxIndex = xCooSys->getMaximumAxisIndexByDimension(1); for(sal_Int32 nI=0; nI<=nMaxIndex; ++nI) { - Reference< chart2::XAxis > xAxis( xCooSys->getAxisByDimension( 1,nI )); + rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2( 1,nI ); if( xAxis.is()) { bool bPercent = (getStackMode(0) == StackMode::YStackedPercent); diff --git a/chart2/source/model/template/NetChartType.cxx b/chart2/source/model/template/NetChartType.cxx index 971befddfca9..8441215818d8 100644 --- a/chart2/source/model/template/NetChartType.cxx +++ b/chart2/source/model/template/NetChartType.cxx @@ -22,6 +22,7 @@ #include <servicenames_charttypes.hxx> #include <AxisIndexDefines.hxx> #include <AxisHelper.hxx> +#include <Axis.hxx> #include <cppuhelper/supportsservice.hxx> #include <com/sun/star/chart2/AxisType.hpp> @@ -58,7 +59,7 @@ Reference< XCoordinateSystem > SAL_CALL rtl::Reference< PolarCoordinateSystem > xResult = new PolarCoordinateSystem( DimensionCount ); - Reference< XAxis > xAxis( xResult->getAxisByDimension( 0, MAIN_AXIS_INDEX ) ); + rtl::Reference< Axis > xAxis = xResult->getAxisByDimension2( 0, MAIN_AXIS_INDEX ); if( xAxis.is() ) { ScaleData aScaleData = xAxis->getScaleData(); @@ -68,7 +69,7 @@ Reference< XCoordinateSystem > SAL_CALL xAxis->setScaleData( aScaleData ); } - xAxis = xResult->getAxisByDimension( 1, MAIN_AXIS_INDEX ); + xAxis = xResult->getAxisByDimension2( 1, MAIN_AXIS_INDEX ); if( xAxis.is() ) { ScaleData aScaleData = xAxis->getScaleData(); diff --git a/chart2/source/model/template/PieChartType.cxx b/chart2/source/model/template/PieChartType.cxx index 1208283fcc1e..4727a47acc26 100644 --- a/chart2/source/model/template/PieChartType.cxx +++ b/chart2/source/model/template/PieChartType.cxx @@ -20,6 +20,7 @@ #include "PieChartType.hxx" #include <PropertyHelper.hxx> #include <PolarCoordinateSystem.hxx> +#include <Axis.hxx> #include <AxisHelper.hxx> #include <servicenames_charttypes.hxx> #include <AxisIndexDefines.hxx> @@ -158,7 +159,7 @@ Reference< chart2::XCoordinateSystem > SAL_CALL for( sal_Int32 i=0; i<DimensionCount; ++i ) { - Reference< chart2::XAxis > xAxis( xResult->getAxisByDimension( i, MAIN_AXIS_INDEX ) ); + rtl::Reference< Axis > xAxis = xResult->getAxisByDimension2( i, MAIN_AXIS_INDEX ); if( !xAxis.is() ) { OSL_FAIL("a created coordinate system should have an axis for each dimension"); diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx index 9b7ef05323fc..46a3e57e2a88 100644 --- a/chart2/source/model/template/PieChartTypeTemplate.cxx +++ b/chart2/source/model/template/PieChartTypeTemplate.cxx @@ -27,6 +27,7 @@ #include <servicenames_charttypes.hxx> #include <DataSeries.hxx> #include <DataSeriesHelper.hxx> +#include <Axis.hxx> #include <AxisHelper.hxx> #include <ThreeDHelper.hxx> #include <PropertyHelper.hxx> @@ -238,8 +239,8 @@ void PieChartTypeTemplate::adaptScales( { try { - Reference< chart2::XAxis > xAxis( AxisHelper::getAxis( 1 /*nDimensionIndex*/,0 /*nAxisIndex*/ - , coords ) ); + rtl::Reference< Axis > xAxis = AxisHelper::getAxis( 1 /*nDimensionIndex*/,0 /*nAxisIndex*/ + , coords ); if( xAxis.is() ) { chart2::ScaleData aScaleData( xAxis->getScaleData() ); diff --git a/chart2/source/model/template/ScatterChartType.cxx b/chart2/source/model/template/ScatterChartType.cxx index 63d46fed23b9..1835abc10a1d 100644 --- a/chart2/source/model/template/ScatterChartType.cxx +++ b/chart2/source/model/template/ScatterChartType.cxx @@ -21,6 +21,7 @@ #include <PropertyHelper.hxx> #include <servicenames_charttypes.hxx> #include <CartesianCoordinateSystem.hxx> +#include <Axis.hxx> #include <AxisHelper.hxx> #include <AxisIndexDefines.hxx> #include <unonames.hxx> @@ -168,7 +169,7 @@ Reference< chart2::XCoordinateSystem > SAL_CALL for( sal_Int32 i=0; i<DimensionCount; ++i ) { - Reference< chart2::XAxis > xAxis( xResult->getAxisByDimension( i, MAIN_AXIS_INDEX ) ); + rtl::Reference< Axis > xAxis = xResult->getAxisByDimension2( i, MAIN_AXIS_INDEX ); if( !xAxis.is() ) { OSL_FAIL("a created coordinate system should have an axis for each dimension"); |