diff options
Diffstat (limited to 'chart2/source/controller')
21 files changed, 120 insertions, 140 deletions
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx index e49239935c6d..e7f4129df17b 100644 --- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx @@ -19,6 +19,7 @@ #include "DataSeriesPointWrapper.hxx" #include "Chart2ModelContact.hxx" +#include <ChartType.hxx> #include <ChartTypeHelper.hxx> #include <DiagramHelper.hxx> #include <LinePropertiesHelper.hxx> diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index d9deba9857d4..cb28be651c19 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -28,6 +28,7 @@ #include <DiagramHelper.hxx> #include <DataSourceHelper.hxx> #include <ChartModelHelper.hxx> +#include <ChartType.hxx> #include <WrappedIgnoreProperty.hxx> #include "WrappedAxisAndGridExistenceProperties.hxx" #include "WrappedStatisticProperties.hxx" @@ -438,7 +439,7 @@ struct StaticDiagramWrapperPropertyArray : public rtl::StaticAggregate< Sequence bool lcl_isXYChart( const Reference< chart2::XDiagram >& rDiagram ) { bool bRet = false; - Reference< chart2::XChartType > xChartType( ::chart::DiagramHelper::getChartTypeByIndex( rDiagram, 0 ) ); + rtl::Reference< ::chart::ChartType > xChartType( ::chart::DiagramHelper::getChartTypeByIndex( rDiagram, 0 ) ); if( xChartType.is() ) { OUString aChartType( xChartType->getChartType() ); @@ -613,7 +614,7 @@ OUString SAL_CALL DiagramWrapper::getDiagramType() { // none of the standard templates matched // use first chart type - Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) ); + rtl::Reference< ChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) ); if( xChartType.is() ) { aRet = xChartType->getChartType(); diff --git a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx index 516a96b2a042..e14993312dbb 100644 --- a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx @@ -19,6 +19,7 @@ #include "MinMaxLineWrapper.hxx" #include "Chart2ModelContact.hxx" +#include <ChartType.hxx> #include <DiagramHelper.hxx> #include <servicenames_charttypes.hxx> #include <cppuhelper/propshlp.hxx> @@ -157,31 +158,27 @@ void SAL_CALL MinMaxLineWrapper::setPropertyValue( const OUString& rPropertyName Reference< beans::XPropertySet > xPropSet; rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() ); - const Sequence< Reference< chart2::XChartType > > aTypes( + const std::vector< rtl::Reference< ChartType > > & aTypes( ::chart::DiagramHelper::getChartTypesFromDiagram( xDiagram ) ); - for( Reference< chart2::XChartType > const & xType : aTypes ) + for( rtl::Reference< ChartType > const & xType : aTypes ) { if( xType->getChartType() == CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK ) { - Reference< chart2::XDataSeriesContainer > xSeriesContainer(xType,uno::UNO_QUERY); - if( xSeriesContainer.is() ) + Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xType->getDataSeries() ); + if(aSeriesSeq.hasElements()) { - Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xSeriesContainer->getDataSeries() ); - if(aSeriesSeq.hasElements()) + xPropSet.set(aSeriesSeq[0],uno::UNO_QUERY); + if(xPropSet.is()) { - xPropSet.set(aSeriesSeq[0],uno::UNO_QUERY); - if(xPropSet.is()) - { - if( rPropertyName == "LineColor" ) - xPropSet->setPropertyValue( "Color", rValue ); - else if( rPropertyName == "LineTransparence" ) - xPropSet->setPropertyValue( "Transparency", rValue ); - else if( rPropertyName == m_aWrappedLineJointProperty.getOuterName() ) - m_aWrappedLineJointProperty.setPropertyValue( rValue, xPropSet ); - else - xPropSet->setPropertyValue( rPropertyName, rValue ); - return; - } + if( rPropertyName == "LineColor" ) + xPropSet->setPropertyValue( "Color", rValue ); + else if( rPropertyName == "LineTransparence" ) + xPropSet->setPropertyValue( "Transparency", rValue ); + else if( rPropertyName == m_aWrappedLineJointProperty.getOuterName() ) + m_aWrappedLineJointProperty.setPropertyValue( rValue, xPropSet ); + else + xPropSet->setPropertyValue( rPropertyName, rValue ); + return; } } } @@ -194,21 +191,17 @@ uno::Any SAL_CALL MinMaxLineWrapper::getPropertyValue( const OUString& rProperty Reference< beans::XPropertySet > xPropSet; rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() ); - const Sequence< Reference< chart2::XChartType > > aTypes( + const std::vector< rtl::Reference< ChartType > > aTypes( ::chart::DiagramHelper::getChartTypesFromDiagram( xDiagram ) ); - for( Reference< chart2::XChartType > const & xType : aTypes ) + for( rtl::Reference< ChartType > const & xType : aTypes ) { if( xType->getChartType() == CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK ) { - Reference< chart2::XDataSeriesContainer > xSeriesContainer(xType,uno::UNO_QUERY); - if( xSeriesContainer.is() ) + Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xType->getDataSeries() ); + if(aSeriesSeq.hasElements()) { - Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xSeriesContainer->getDataSeries() ); - if(aSeriesSeq.hasElements()) - { - xPropSet.set(aSeriesSeq[0],uno::UNO_QUERY); - break; - } + xPropSet.set(aSeriesSeq[0],uno::UNO_QUERY); + break; } } } diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx index 2922f91c466b..6a80eae044bb 100644 --- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx @@ -19,6 +19,7 @@ #include "UpDownBarWrapper.hxx" #include "Chart2ModelContact.hxx" +#include <ChartType.hxx> #include <DiagramHelper.hxx> #include <servicenames_charttypes.hxx> #include <cppuhelper/supportsservice.hxx> @@ -162,17 +163,13 @@ void SAL_CALL UpDownBarWrapper::setPropertyValue( const OUString& rPropertyName, { Reference< beans::XPropertySet > xPropSet; - const Sequence< Reference< chart2::XChartType > > aTypes( + const std::vector< rtl::Reference< ChartType > > aTypes( ::chart::DiagramHelper::getChartTypesFromDiagram( m_spChart2ModelContact->getDiagram() ) ); - for( Reference< chart2::XChartType > const & xType : aTypes ) + for( rtl::Reference< ChartType > const & xType : aTypes ) { if( xType->getChartType() == CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK ) { - Reference< beans::XPropertySet > xTypeProps( xType, uno::UNO_QUERY ); - if(xTypeProps.is()) - { - xTypeProps->getPropertyValue( m_aPropertySetName ) >>= xPropSet; - } + xType->getPropertyValue( m_aPropertySetName ) >>= xPropSet; } } if(xPropSet.is()) @@ -184,17 +181,13 @@ uno::Any SAL_CALL UpDownBarWrapper::getPropertyValue( const OUString& rPropertyN Reference< beans::XPropertySet > xPropSet; - const Sequence< Reference< chart2::XChartType > > aTypes( + const std::vector< rtl::Reference< ChartType > > aTypes( ::chart::DiagramHelper::getChartTypesFromDiagram( m_spChart2ModelContact->getDiagram() ) ); - for( Reference< chart2::XChartType > const & xType : aTypes ) + for( rtl::Reference<ChartType > const & xType : aTypes ) { if( xType->getChartType() == CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK ) { - Reference< beans::XPropertySet > xTypeProps( xType, uno::UNO_QUERY ); - if(xTypeProps.is()) - { - xTypeProps->getPropertyValue( m_aPropertySetName ) >>= xPropSet; - } + xType->getPropertyValue( m_aPropertySetName ) >>= xPropSet; } } if(xPropSet.is()) diff --git a/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx index c0f100d335a7..e613161bf10f 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx @@ -19,6 +19,7 @@ #include "WrappedGapwidthProperty.hxx" #include "Chart2ModelContact.hxx" +#include <ChartType.hxx> #include <DiagramHelper.hxx> #include <tools/long.hxx> @@ -72,29 +73,25 @@ void WrappedBarPositionProperty_Base::setPropertyValue( const Any& rOuterValue, if( m_nDimensionIndex!=1 ) return; - const Sequence< Reference< chart2::XChartType > > aChartTypeList( DiagramHelper::getChartTypesFromDiagram( xDiagram ) ); - for( Reference< chart2::XChartType > const & chartType : aChartTypeList ) + const std::vector< rtl::Reference< ChartType > > aChartTypeList( DiagramHelper::getChartTypesFromDiagram( xDiagram ) ); + for( rtl::Reference< ChartType > const & chartType : aChartTypeList ) { try { - Reference< beans::XPropertySet > xProp( chartType, uno::UNO_QUERY ); - if( xProp.is() ) + Sequence< sal_Int32 > aBarPositionSequence; + chartType->getPropertyValue( m_InnerSequencePropertyName ) >>= aBarPositionSequence; + + tools::Long nOldLength = aBarPositionSequence.getLength(); + if( nOldLength <= m_nAxisIndex ) + aBarPositionSequence.realloc( m_nAxisIndex+1 ); + auto pBarPositionSequence = aBarPositionSequence.getArray(); + for( sal_Int32 i=nOldLength; i<m_nAxisIndex; i++ ) { - Sequence< sal_Int32 > aBarPositionSequence; - xProp->getPropertyValue( m_InnerSequencePropertyName ) >>= aBarPositionSequence; - - tools::Long nOldLength = aBarPositionSequence.getLength(); - if( nOldLength <= m_nAxisIndex ) - aBarPositionSequence.realloc( m_nAxisIndex+1 ); - auto pBarPositionSequence = aBarPositionSequence.getArray(); - for( sal_Int32 i=nOldLength; i<m_nAxisIndex; i++ ) - { - pBarPositionSequence[i] = m_nDefaultValue; - } - pBarPositionSequence[m_nAxisIndex] = nNewValue; - - xProp->setPropertyValue( m_InnerSequencePropertyName, uno::Any( aBarPositionSequence ) ); + pBarPositionSequence[i] = m_nDefaultValue; } + pBarPositionSequence[m_nAxisIndex] = nNewValue; + + chartType->setPropertyValue( m_InnerSequencePropertyName, uno::Any( aBarPositionSequence ) ); } catch( uno::Exception& e ) { @@ -115,21 +112,17 @@ Any WrappedBarPositionProperty_Base::getPropertyValue( const Reference< beans::X if( m_nDimensionIndex==1 ) { - Sequence< Reference< chart2::XChartType > > aChartTypeList( DiagramHelper::getChartTypesFromDiagram( xDiagram ) ); - for( sal_Int32 nN = 0; nN < aChartTypeList.getLength() && !bInnerValueDetected; nN++ ) + std::vector< rtl::Reference< ChartType > > aChartTypeList( DiagramHelper::getChartTypesFromDiagram( xDiagram ) ); + for( sal_Int32 nN = 0; nN < static_cast<sal_Int32>(aChartTypeList.size()) && !bInnerValueDetected; nN++ ) { try { - Reference< beans::XPropertySet > xProp( aChartTypeList[nN], uno::UNO_QUERY ); - if( xProp.is() ) + Sequence< sal_Int32 > aBarPositionSequence; + aChartTypeList[nN]->getPropertyValue( m_InnerSequencePropertyName ) >>= aBarPositionSequence; + if( m_nAxisIndex < aBarPositionSequence.getLength() ) { - Sequence< sal_Int32 > aBarPositionSequence; - xProp->getPropertyValue( m_InnerSequencePropertyName ) >>= aBarPositionSequence; - if( m_nAxisIndex < aBarPositionSequence.getLength() ) - { - nInnerValue = aBarPositionSequence[m_nAxisIndex]; - bInnerValueDetected = true; - } + nInnerValue = aBarPositionSequence[m_nAxisIndex]; + bInnerValueDetected = true; } } catch( uno::Exception& e ) diff --git a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx index 6d088a50bd81..102acfb02ba2 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx @@ -20,6 +20,7 @@ #include "WrappedSplineProperties.hxx" #include "Chart2ModelContact.hxx" #include <FastPropertyIdRanges.hxx> +#include <ChartType.hxx> #include <DiagramHelper.hxx> #include <WrappedProperty.hxx> #include <unonames.hxx> @@ -62,17 +63,13 @@ public: { bool bHasDetectableInnerValue = false; rHasAmbiguousValue = false; - Sequence< css::uno::Reference< css::chart2::XChartType > > aChartTypes( + std::vector< rtl::Reference< ChartType > > aChartTypes( ::chart::DiagramHelper::getChartTypesFromDiagram( m_spChart2ModelContact->getDiagram() ) ); - for( sal_Int32 nN = aChartTypes.getLength(); nN--; ) + for( sal_Int32 nN = aChartTypes.size(); nN--; ) { try { - uno::Reference<beans::XPropertySet> xChartTypePropertySet(aChartTypes[nN], uno::UNO_QUERY); - if (!xChartTypePropertySet.is()) - continue; - - Any aSingleValue = convertInnerToOuterValue( xChartTypePropertySet->getPropertyValue(m_aOwnInnerName) ); + Any aSingleValue = convertInnerToOuterValue( aChartTypes[nN]->getPropertyValue(m_aOwnInnerName) ); PROPERTYTYPE aCurValue = PROPERTYTYPE(); aSingleValue >>= aCurValue; if( !bHasDetectableInnerValue ) @@ -114,17 +111,13 @@ public: if( !(bHasAmbiguousValue || aNewValue != aOldValue) ) return; - Sequence< css::uno::Reference< css::chart2::XChartType > > aChartTypes( + std::vector< rtl::Reference< ChartType > > aChartTypes( ::chart::DiagramHelper::getChartTypesFromDiagram( m_spChart2ModelContact->getDiagram() ) ); - for( sal_Int32 nN = aChartTypes.getLength(); nN--; ) + for( sal_Int32 nN = aChartTypes.size(); nN--; ) { try { - css::uno::Reference< css::beans::XPropertySet > xChartTypePropertySet( aChartTypes[nN], css::uno::UNO_QUERY ); - if( xChartTypePropertySet.is() ) - { - xChartTypePropertySet->setPropertyValue(m_aOwnInnerName,convertOuterToInnerValue(uno::Any(aNewValue))); - } + aChartTypes[nN]->setPropertyValue(m_aOwnInnerName,convertOuterToInnerValue(uno::Any(aNewValue))); } catch( uno::Exception & ex ) { diff --git a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx index 484861b68338..7e29348728a8 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx @@ -20,6 +20,7 @@ #include "WrappedSymbolProperties.hxx" #include "WrappedSeriesOrDiagramProperty.hxx" #include <FastPropertyIdRanges.hxx> +#include <ChartType.hxx> #include <ChartTypeHelper.hxx> #include <com/sun/star/chart2/Symbol.hpp> #include <com/sun/star/chart2/SymbolStyle.hpp> @@ -286,7 +287,7 @@ beans::PropertyState WrappedSymbolTypeProperty::getPropertyState( const Referenc { rtl::Reference< ::chart::Diagram > xDiagram( m_spChart2ModelContact->getDiagram() ); Reference< chart2::XDataSeries > xSeries( xInnerPropertyState, uno::UNO_QUERY ); - Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) ); + rtl::Reference< ChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) ); if( ChartTypeHelper::isSupportingSymbolProperties( xChartType, 2 ) ) return beans::PropertyState_DIRECT_VALUE; } diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx index c73781770549..0455adf3212f 100644 --- a/chart2/source/controller/dialogs/DataBrowserModel.cxx +++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx @@ -20,6 +20,7 @@ #include "DataBrowserModel.hxx" #include "DialogModel.hxx" #include <ChartModelHelper.hxx> +#include <ChartType.hxx> #include <ChartTypeManager.hxx> #include <DiagramHelper.hxx> #include <Diagram.hxx> @@ -293,7 +294,7 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex ) sal_Int32 nStartCol = 0; rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram(m_xChartDocument); - Reference<chart2::XChartType> xChartType; + rtl::Reference<ChartType> xChartType; Reference<chart2::XDataSeries> xSeries; if (o3tl::make_unsigned(nAfterColumnIndex) < m_aColumns.size()) // Get the data series at specific column position (if available). @@ -303,7 +304,7 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex ) if( xSeries.is()) { // Use the chart type of the currently selected data series. - xChartType.set( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries )); + xChartType = DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ); // Find the corresponding header and determine the last column of this // data series. @@ -321,7 +322,7 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex ) else { // No data series at specified column position. Use the first chart type. - xChartType.set( DiagramHelper::getChartTypeByIndex( xDiagram, 0 )); + xChartType = DiagramHelper::getChartTypeByIndex( xDiagram, 0 ); nStartCol = nAfterColumnIndex; } @@ -330,10 +331,7 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex ) // Get shared sequences of current series. Normally multiple data series // only share "values-x" sequences. (TODO: simplify this logic). - Reference< chart2::XDataSeriesContainer > xSeriesCnt( xChartType, uno::UNO_QUERY ); - lcl_tSharedSeqVec aSharedSequences; - if( xSeriesCnt.is()) - aSharedSequences = lcl_getSharedSequences( xSeriesCnt->getDataSeries()); + lcl_tSharedSeqVec aSharedSequences = lcl_getSharedSequences( xChartType->getDataSeries()); Reference<chart2::XDataSeries> xNewSeries = m_apDialogModel->insertSeriesAfter(xSeries, xChartType, true); diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx index 73b438acef92..0efd1d979afe 100644 --- a/chart2/source/controller/dialogs/DialogModel.cxx +++ b/chart2/source/controller/dialogs/DialogModel.cxx @@ -26,6 +26,7 @@ #include <strings.hrc> #include <ResId.hxx> #include <ControllerLockGuard.hxx> +#include <ChartType.hxx> #include <ChartTypeHelper.hxx> #include <ChartTypeTemplate.hxx> #include <ThreeDHelper.hxx> @@ -290,7 +291,7 @@ Sequence< OUString > lcl_CopyExcludingValuesFirst( Reference< XDataSeries > lcl_CreateNewSeries( const Reference< uno::XComponentContext > & xContext, - const Reference< XChartType > & xChartType, + const uno::Reference< XChartType > & xChartType, sal_Int32 nNewSeriesIndex, sal_Int32 nTotalNumberOfSeriesInCTGroup, const Reference< XDiagram > & xDiagram, @@ -316,12 +317,14 @@ Reference< XDataSeries > lcl_CreateNewSeries( sal_Int32 nGroupIndex=0; if( xChartType.is()) { - Sequence< Reference< XChartType > > aCTs( + auto pChartType = dynamic_cast<::chart::ChartType*>(xChartType.get()); + assert(pChartType); + std::vector< rtl::Reference< ::chart::ChartType > > aCTs( ::chart::DiagramHelper::getChartTypesFromDiagram( xDiagram )); - for( ; nGroupIndex<aCTs.getLength(); ++nGroupIndex) - if( aCTs[nGroupIndex] == xChartType ) + for( ; nGroupIndex < static_cast<sal_Int32>(aCTs.size()); ++nGroupIndex) + if( aCTs[nGroupIndex] == pChartType ) break; - if( nGroupIndex == aCTs.getLength()) + if( nGroupIndex == static_cast<sal_Int32>(aCTs.size())) nGroupIndex = 0; } xTemplate->applyStyle( xResult, nGroupIndex, nNewSeriesIndex, nTotalNumberOfSeriesInCTGroup ); diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx index 201671e87bcf..4053d3a75599 100644 --- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx +++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx @@ -27,6 +27,7 @@ #include <AxisHelper.hxx> #include <ChartModel.hxx> #include <ChartModelHelper.hxx> +#include <ChartType.hxx> #include <DiagramHelper.hxx> #include <Diagram.hxx> #include <DataSeriesHelper.hxx> @@ -66,7 +67,7 @@ OUString lcl_getDataSeriesName( const OUString& rObjectCID, const rtl::Reference Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rObjectCID , xChartModel ); if( xDiagram.is() && xSeries.is() ) { - Reference< XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) ); + rtl::Reference< ChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) ); if( xChartType.is() ) { aRet = ::chart::DataSeriesHelper::getDataSeriesLabel( diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx index 84740d9bf708..e1d4c0175845 100644 --- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx +++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx @@ -34,6 +34,7 @@ #include <ResId.hxx> #include <ViewElementListProvider.hxx> #include <ChartModelHelper.hxx> +#include <ChartType.hxx> #include <ChartTypeHelper.hxx> #include <ObjectNameProvider.hxx> #include <DiagramHelper.hxx> @@ -115,7 +116,7 @@ void ObjectPropertiesDialogParameter::init( const rtl::Reference<::chart::ChartM m_xChartDocument = xChartModel; rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartModel ); uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aObjectCID, xChartModel ); - uno::Reference< XChartType > xChartType = ChartModelHelper::getChartTypeOfSeries( xChartModel, xSeries ); + rtl::Reference< ChartType > xChartType = ChartModelHelper::getChartTypeOfSeries( xChartModel, xSeries ); sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram ); bool bHasSeriesProperties = (m_eObjectType==OBJECTTYPE_DATA_SERIES); diff --git a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx index 3a76aa57f6dd..3385330e913c 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx @@ -20,6 +20,7 @@ #include "tp_3D_SceneGeometry.hxx" #include <DiagramHelper.hxx> +#include <ChartType.hxx> #include <ChartTypeHelper.hxx> #include <ThreeDHelper.hxx> #include <ControllerLockGuard.hxx> diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx index cb53acb3a873..bc09b1bda1b9 100644 --- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx @@ -29,6 +29,7 @@ #include <ChartModel.hxx> #include <AxisHelper.hxx> #include <CommonConverters.hxx> +#include <ChartType.hxx> #include <ChartTypeHelper.hxx> #include <Diagram.hxx> #include <unonames.hxx> diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx index 264bdf92af3b..34d81b353bdc 100644 --- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx @@ -30,6 +30,7 @@ #include <Diagram.hxx> #include <ChartModel.hxx> #include <ChartModelHelper.hxx> +#include <ChartType.hxx> #include <ChartTypeHelper.hxx> #include <unonames.hxx> @@ -237,7 +238,7 @@ DataPointItemConverter::DataPointItemConverter( } rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram(xChartModel) ); - uno::Reference< XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram , xSeries ) ); + rtl::Reference< ChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram , xSeries ) ); bool bFound = false; bool bAmbiguous = false; bool bSwapXAndY = DiagramHelper::getVertical( xDiagram, bFound, bAmbiguous ); diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx index 4d035c061b6c..5080b4d8be01 100644 --- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx @@ -21,6 +21,7 @@ #include "SchWhichPairs.hxx" #include <ChartModelHelper.hxx> +#include <ChartType.hxx> #include <AxisHelper.hxx> #include <DiagramHelper.hxx> #include <Diagram.hxx> @@ -74,7 +75,7 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter( m_bAttachToMainAxis = DiagramHelper::isSeriesAttachedToMainAxis( xDataSeries ); rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram(xChartModel) ); - uno::Reference< XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram , xDataSeries ) ); + rtl::Reference< ChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram , xDataSeries ) ); m_xCooSys = DataSeriesHelper::getCoordinateSystemOfSeries( xDataSeries, xDiagram ); if( m_xCooSys.is() ) @@ -93,15 +94,14 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter( sal_Int32 nAxisIndex = DataSeriesHelper::getAttachedAxisIndex(xDataSeries); uno::Sequence< sal_Int32 > aBarPositionSequence; - uno::Reference< beans::XPropertySet > xChartTypeProps( xChartType, uno::UNO_QUERY ); - if( xChartTypeProps.is() ) + if( xChartType.is() ) { - if( xChartTypeProps->getPropertyValue( "OverlapSequence" ) >>= aBarPositionSequence ) + if( xChartType->getPropertyValue( "OverlapSequence" ) >>= aBarPositionSequence ) { if( nAxisIndex >= 0 && nAxisIndex < aBarPositionSequence.getLength() ) m_nBarOverlap = aBarPositionSequence[nAxisIndex]; } - if( xChartTypeProps->getPropertyValue( "GapwidthSequence" ) >>= aBarPositionSequence ) + if( xChartType->getPropertyValue( "GapwidthSequence" ) >>= aBarPositionSequence ) { if( nAxisIndex >= 0 && nAxisIndex < aBarPositionSequence.getLength() ) m_nGapWidth = aBarPositionSequence[nAxisIndex]; @@ -206,28 +206,25 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const Sf uno::Reference< XDataSeries > xDataSeries( GetPropertySet(), uno::UNO_QUERY ); rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram(m_xChartModel) ); - uno::Reference< beans::XPropertySet > xChartTypeProps( DiagramHelper::getChartTypeOfSeries( xDiagram , xDataSeries ), uno::UNO_QUERY ); - if( xChartTypeProps.is() ) + rtl::Reference< ChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram , xDataSeries ) ); + if( xChartType.is() ) { sal_Int32 nAxisIndex = DataSeriesHelper::getAttachedAxisIndex(xDataSeries); uno::Sequence< sal_Int32 > aBarPositionSequence; - if( xChartTypeProps.is() ) + if( xChartType->getPropertyValue( aPropName ) >>= aBarPositionSequence ) { - if( xChartTypeProps->getPropertyValue( aPropName ) >>= aBarPositionSequence ) + bool bGroupBarsPerAxis = rItemSet.Get( SCHATTR_GROUP_BARS_PER_AXIS ).GetValue(); + if(!bGroupBarsPerAxis) { - bool bGroupBarsPerAxis = rItemSet.Get( SCHATTR_GROUP_BARS_PER_AXIS ).GetValue(); - if(!bGroupBarsPerAxis) - { - //set the same value for all axes - for( auto & pos : asNonConstRange(aBarPositionSequence) ) - pos = rBarPosition; - } - else if( nAxisIndex >= 0 && nAxisIndex < aBarPositionSequence.getLength() ) - aBarPositionSequence.getArray()[nAxisIndex] = rBarPosition; - - xChartTypeProps->setPropertyValue( aPropName, uno::Any(aBarPositionSequence) ); - bChanged = true; + //set the same value for all axes + for( auto & pos : asNonConstRange(aBarPositionSequence) ) + pos = rBarPosition; } + else if( nAxisIndex >= 0 && nAxisIndex < aBarPositionSequence.getLength() ) + aBarPositionSequence.getArray()[nAxisIndex] = rBarPosition; + + xChartType->setPropertyValue( aPropName, uno::Any(aBarPositionSequence) ); + bChanged = true; } } } diff --git a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx index 36a0686e95f7..ea7e3b9c59fd 100644 --- a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx @@ -21,6 +21,7 @@ #include <CharacterPropertyItemConverter.hxx> #include <ChartModel.hxx> #include <ChartModelHelper.hxx> +#include <ChartType.hxx> #include <ChartTypeHelper.hxx> #include <DataSeriesHelper.hxx> #include <DiagramHelper.hxx> @@ -210,7 +211,7 @@ TextLabelItemConverter::TextLabelItemConverter( maConverters.emplace_back(new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize")); rtl::Reference< Diagram > xDiagram(ChartModelHelper::findDiagram(xChartModel)); - uno::Reference<XChartType> xChartType(DiagramHelper::getChartTypeOfSeries(xDiagram, xSeries)); + rtl::Reference< ChartType > xChartType(DiagramHelper::getChartTypeOfSeries(xDiagram, xSeries)); bool bFound = false; bool bAmbiguous = false; bool bSwapXAndY = DiagramHelper::getVertical(xDiagram, bFound, bAmbiguous); diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx index df0da042a218..f4d5aaa6209d 100644 --- a/chart2/source/controller/main/ChartController_Properties.cxx +++ b/chart2/source/controller/main/ChartController_Properties.cxx @@ -40,6 +40,7 @@ #include <ChartModelHelper.hxx> #include <AxisHelper.hxx> #include <TitleHelper.hxx> +#include <ChartType.hxx> #include <ChartTypeHelper.hxx> #include <ChartModel.hxx> #include <ColorPerPointHelper.hxx> @@ -198,7 +199,7 @@ wrapper::ItemConverter* createItemConverter( wrapper::GraphicObjectType::FilledDataPoint; uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( aObjectCID, xChartModel ); - uno::Reference< XChartType > xChartType = ChartModelHelper::getChartTypeOfSeries( xChartModel, xSeries ); + rtl::Reference< ChartType > xChartType = ChartModelHelper::getChartTypeOfSeries( xChartModel, xSeries ); rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( xChartModel ); sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram ); diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index b8d925427736..c8aa8a694e7d 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -28,6 +28,7 @@ #include <ResId.hxx> #include <ChartModel.hxx> #include <ChartModelHelper.hxx> +#include <ChartType.hxx> #include <DiagramHelper.hxx> #include <Diagram.hxx> #include <TitleHelper.hxx> @@ -1100,22 +1101,18 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatDataSeries" ); } - Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) ); + rtl::Reference< ChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) ); if( xChartType->getChartType() == CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK ) { try { - Reference< beans::XPropertySet > xChartTypeProp( xChartType, uno::UNO_QUERY ); - if( xChartTypeProp.is() ) - { - bool bJapaneseStyle = false; - xChartTypeProp->getPropertyValue( "Japanese" ) >>= bJapaneseStyle; + bool bJapaneseStyle = false; + xChartType->getPropertyValue( "Japanese" ) >>= bJapaneseStyle; - if( bJapaneseStyle ) - { - lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatStockLoss" ); - lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatStockGain" ); - } + if( bJapaneseStyle ) + { + lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatStockLoss" ); + lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatStockGain" ); } } catch( const uno::Exception & ) diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index 9da88ea5d6c7..af549e1722bc 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -26,6 +26,7 @@ #include <TitleHelper.hxx> #include <LegendHelper.hxx> #include <ObjectIdentifier.hxx> +#include <ChartType.hxx> #include <ChartTypeHelper.hxx> #include <ChartController.hxx> #include <RegressionCurveHelper.hxx> @@ -406,7 +407,7 @@ void ModelState::update( const rtl::Reference<::chart::ChartModel> & xModel ) sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram ); - uno::Reference< chart2::XChartType > xFirstChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) ); + rtl::Reference< ChartType > xFirstChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) ); bSupportsStatistics = ChartTypeHelper::isSupportingStatisticProperties( xFirstChartType, nDimensionCount ); bSupportsAxes = ChartTypeHelper::isSupportingMainAxis( xFirstChartType, nDimensionCount, 0 ); diff --git a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx index 030fcd0bf8bc..2af1c013d826 100644 --- a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx +++ b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx @@ -25,6 +25,7 @@ #include <ChartModel.hxx> #include <DiagramHelper.hxx> #include <Diagram.hxx> +#include <ChartType.hxx> #include <ChartTypeHelper.hxx> #include <ThreeDHelper.hxx> #include <defines.hxx> diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx index 1fb449026f3a..4649b422d79f 100644 --- a/chart2/source/controller/main/ObjectHierarchy.cxx +++ b/chart2/source/controller/main/ObjectHierarchy.cxx @@ -25,6 +25,7 @@ #include <RegressionCurveHelper.hxx> #include <AxisHelper.hxx> #include <chartview/ExplicitValueProvider.hxx> +#include <ChartType.hxx> #include <ChartTypeHelper.hxx> #include <ChartModel.hxx> #include <DataSeriesHelper.hxx> @@ -216,7 +217,7 @@ void ObjectHierarchy::createAxesTree( { Reference< XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW ); sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram ); - uno::Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) ); + rtl::Reference< ChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) ); bool bSupportsAxesGrids = ChartTypeHelper::isSupportingMainAxis( xChartType, nDimensionCount, 0 ); if( !bSupportsAxesGrids ) return; |