diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-02-01 20:34:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-03 14:26:22 +0100 |
commit | 6b14014342a665268b822729d465e9d3a3a2ca57 (patch) | |
tree | 413d6fe0a442412f2480f0a35c2019b34907a951 /chart2 | |
parent | d4f61a594608219d08b489205ebb5569d905f444 (diff) |
make css::chart2::InterpretedData a normal struct
this is internal-only, no need for it to use UNO IDL
Change-Id: I5f9844f48640618ac5bd348721bdee43e5f0a57f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129303
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
11 files changed, 49 insertions, 42 deletions
diff --git a/chart2/source/controller/dialogs/DialogModel.hxx b/chart2/source/controller/dialogs/DialogModel.hxx index 7d70a3b82cd5..6e053f84b257 100644 --- a/chart2/source/controller/dialogs/DialogModel.hxx +++ b/chart2/source/controller/dialogs/DialogModel.hxx @@ -37,7 +37,6 @@ namespace com::sun::star::chart2 { class XDataSeriesContainer; class XDataSeries; class XChartType; - struct InterpretedData; namespace data { class XDataProvider; class XLabeledDataSequence; @@ -46,10 +45,10 @@ namespace com::sun::star::chart2 { namespace chart { - class ChartType; class ChartTypeTemplate; class DataSeries; +struct InterpretedData; class RangeSelectionHelper; struct DialogModelTimeBasedInfo @@ -168,7 +167,7 @@ private: private: void applyInterpretedData( - const css::chart2::InterpretedData & rNewData, + const InterpretedData & rNewData, const std::vector< rtl::Reference< ::chart::DataSeries > > & rSeriesToReUse ); sal_Int32 countSeries() const; diff --git a/chart2/source/inc/DataInterpreter.hxx b/chart2/source/inc/DataInterpreter.hxx index d4736c00d834..561b86f2bfee 100644 --- a/chart2/source/inc/DataInterpreter.hxx +++ b/chart2/source/inc/DataInterpreter.hxx @@ -21,7 +21,6 @@ #include <cppuhelper/implbase.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/chart2/InterpretedData.hpp> #include <com/sun/star/chart2/data/XDataSource.hpp> #include <com/sun/star/chart2/XDataSeries.hpp> #include "charttoolsdllapi.hxx" @@ -33,6 +32,15 @@ namespace chart class DataSeries; /** offers tooling to interpret different data sources in a structural + and chart-type-dependent way. + */ +struct InterpretedData +{ + css::uno::Sequence< css::uno::Sequence< css::uno::Reference<css::chart2::XDataSeries> > > Series; + css::uno::Reference<css::chart2::data::XLabeledDataSequence> Categories; +}; + +/** offers tooling to interpret different data sources in a structural and chart-type-dependent way. */ class SAL_DLLPUBLIC_RTTI DataInterpreter : public ::cppu::WeakImplHelper< @@ -84,12 +92,12 @@ public: use all the data series given here for the result before creating new ones. */ - css::chart2::InterpretedData interpretDataSource( + InterpretedData interpretDataSource( const css::uno::Reference< css::chart2::data::XDataSource >& xSource, const css::uno::Sequence< css::beans::PropertyValue >& aArguments, const css::uno::Sequence< css::uno::Reference< css::chart2::XDataSeries > >& aSeriesToReUse ); - virtual css::chart2::InterpretedData interpretDataSource( + virtual InterpretedData interpretDataSource( const css::uno::Reference< css::chart2::data::XDataSource >& xSource, const css::uno::Sequence< css::beans::PropertyValue >& aArguments, const std::vector< rtl::Reference< ::chart::DataSeries > >& aSeriesToReUse ); @@ -97,8 +105,8 @@ public: /** Re-interprets the data given in <code>aInterpretedData</code> while keeping the number of data series and the categories. */ - virtual css::chart2::InterpretedData reinterpretDataSeries( - const css::chart2::InterpretedData& aInterpretedData ); + virtual InterpretedData reinterpretDataSeries( + const InterpretedData& aInterpretedData ); /** parses the given data and states, if a reinterpretDataSeries() call can be done @@ -110,7 +118,7 @@ public: the one required is used as output of the data interpreter. */ virtual bool isDataCompatible( - const css::chart2::InterpretedData& aInterpretedData ); + const InterpretedData& aInterpretedData ); /** Try to reverse the operation done in interpretDataSource(). @@ -120,7 +128,7 @@ public: the result of this method should be <code>xSource</code>.</p> */ virtual css::uno::Reference< css::chart2::data::XDataSource > mergeInterpretedData( - const css::chart2::InterpretedData& aInterpretedData ); + const InterpretedData& aInterpretedData ); /** Get chart information that is specific to a particular chart type, by key. diff --git a/chart2/source/model/template/BubbleDataInterpreter.cxx b/chart2/source/model/template/BubbleDataInterpreter.cxx index b0196bdd050e..cac3ea68d343 100644 --- a/chart2/source/model/template/BubbleDataInterpreter.cxx +++ b/chart2/source/model/template/BubbleDataInterpreter.cxx @@ -44,7 +44,7 @@ BubbleDataInterpreter::~BubbleDataInterpreter() } // ____ XDataInterpreter ____ -chart2::InterpretedData BubbleDataInterpreter::interpretDataSource( +InterpretedData BubbleDataInterpreter::interpretDataSource( const Reference< chart2::data::XDataSource >& xSource, const Sequence< beans::PropertyValue >& aArguments, const std::vector< rtl::Reference< DataSeries > >& aSeriesToReUse ) @@ -146,11 +146,11 @@ chart2::InterpretedData BubbleDataInterpreter::interpretDataSource( aSeriesVec.push_back( xSeries ); } - return InterpretedData( { comphelper::containerToSequence(aSeriesVec) }, xCategories ); + return { { comphelper::containerToSequence(aSeriesVec) }, xCategories }; } -chart2::InterpretedData BubbleDataInterpreter::reinterpretDataSeries( - const chart2::InterpretedData& aInterpretedData ) +InterpretedData BubbleDataInterpreter::reinterpretDataSeries( + const InterpretedData& aInterpretedData ) { InterpretedData aResult( aInterpretedData ); @@ -253,7 +253,7 @@ chart2::InterpretedData BubbleDataInterpreter::reinterpretDataSeries( } bool BubbleDataInterpreter::isDataCompatible( - const chart2::InterpretedData& aInterpretedData ) + const InterpretedData& aInterpretedData ) { const Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series )); for( Reference< XDataSeries > const & dataSeries : aSeries ) diff --git a/chart2/source/model/template/BubbleDataInterpreter.hxx b/chart2/source/model/template/BubbleDataInterpreter.hxx index f4bb71f8beb4..ff4b56de615a 100644 --- a/chart2/source/model/template/BubbleDataInterpreter.hxx +++ b/chart2/source/model/template/BubbleDataInterpreter.hxx @@ -31,14 +31,14 @@ public: protected: // ____ DataInterpreter ____ - virtual css::chart2::InterpretedData interpretDataSource( + virtual InterpretedData interpretDataSource( const css::uno::Reference< css::chart2::data::XDataSource >& xSource, const css::uno::Sequence< css::beans::PropertyValue >& aArguments, const std::vector< rtl::Reference< ::chart::DataSeries > >& aSeriesToReUse ) override; - virtual css::chart2::InterpretedData reinterpretDataSeries( - const css::chart2::InterpretedData& aInterpretedData ) override; + virtual InterpretedData reinterpretDataSeries( + const InterpretedData& aInterpretedData ) override; virtual bool isDataCompatible( - const css::chart2::InterpretedData& aInterpretedData ) override; + const InterpretedData& aInterpretedData ) override; }; } // namespace chart diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx index f3c84f853385..8c7ab1e7389a 100644 --- a/chart2/source/model/template/ChartTypeTemplate.cxx +++ b/chart2/source/model/template/ChartTypeTemplate.cxx @@ -152,7 +152,7 @@ rtl::Reference< Diagram > ChartTypeTemplate::createDiagramByDataSource( // modify diagram rtl::Reference< DataInterpreter > xInterpreter( getDataInterpreter()); - chart2::InterpretedData aData( + InterpretedData aData( xInterpreter->interpretDataSource( xDataSource, aArguments, Sequence< Reference< XDataSeries > >() )); @@ -192,7 +192,7 @@ void ChartTypeTemplate::changeDiagram( const rtl::Reference< Diagram >& xDiagram // chart-type specific interpretation of existing data series rtl::Reference< DataInterpreter > xInterpreter( getDataInterpreter()); - chart2::InterpretedData aData; + InterpretedData aData; aData.Series = aSeriesSeq; aData.Categories = DiagramHelper::getCategoriesFromDiagram( xDiagram ); @@ -258,7 +258,7 @@ void ChartTypeTemplate::changeDiagramData( DiagramHelper::getDataSeriesFromDiagram( xDiagram ); const sal_Int32 nFormerSeriesCount = aFlatSeriesSeq.size(); rtl::Reference< DataInterpreter > xInterpreter( getDataInterpreter()); - chart2::InterpretedData aData = + InterpretedData aData = xInterpreter->interpretDataSource( xDataSource, aArguments, aFlatSeriesSeq ); // data series diff --git a/chart2/source/model/template/ColumnLineDataInterpreter.hxx b/chart2/source/model/template/ColumnLineDataInterpreter.hxx index d6318367bc00..c2ec75826007 100644 --- a/chart2/source/model/template/ColumnLineDataInterpreter.hxx +++ b/chart2/source/model/template/ColumnLineDataInterpreter.hxx @@ -30,7 +30,7 @@ public: protected: // ____ DataInterpreter ____ - virtual css::chart2::InterpretedData interpretDataSource( + virtual InterpretedData interpretDataSource( const css::uno::Reference<css::chart2::data::XDataSource>& xSource, const css::uno::Sequence<css::beans::PropertyValue>& aArguments, const std::vector<rtl::Reference<::chart::DataSeries>>& aSeriesToReUse) override; diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx index a206a448871e..3a619e3ec253 100644 --- a/chart2/source/model/template/DataInterpreter.cxx +++ b/chart2/source/model/template/DataInterpreter.cxx @@ -123,7 +123,7 @@ InterpretedData DataInterpreter::interpretDataSource( ++nSeriesIndex; } - return InterpretedData( { comphelper::containerToSequence( aSeriesVec ) }, xCategories ); + return { { comphelper::containerToSequence( aSeriesVec ) }, xCategories }; } InterpretedData DataInterpreter::interpretDataSource( @@ -193,7 +193,7 @@ InterpretedData DataInterpreter::interpretDataSource( ++nSeriesIndex; } - return InterpretedData( { comphelper::containerToSequence( aSeriesVec ) }, xCategories ); + return { { comphelper::containerToSequence( aSeriesVec ) }, xCategories }; } InterpretedData DataInterpreter::reinterpretDataSeries( @@ -252,7 +252,7 @@ InterpretedData DataInterpreter::reinterpretDataSeries( // criterion: all series must have exactly one data::XLabeledDataSequence bool DataInterpreter::isDataCompatible( - const chart2::InterpretedData& aInterpretedData ) + const InterpretedData& aInterpretedData ) { const Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series )); for( Reference< XDataSeries > const & i : aSeries ) diff --git a/chart2/source/model/template/StockDataInterpreter.cxx b/chart2/source/model/template/StockDataInterpreter.cxx index 9860f91927d6..3b9315ee7a30 100644 --- a/chart2/source/model/template/StockDataInterpreter.cxx +++ b/chart2/source/model/template/StockDataInterpreter.cxx @@ -249,7 +249,7 @@ InterpretedData StockDataInterpreter::interpretDataSource( } } - return InterpretedData( aResultSeries, xCategories ); + return { aResultSeries, xCategories }; } // criterion: there must be two groups for stock-charts with volume and all @@ -279,9 +279,9 @@ bool StockDataInterpreter::isDataCompatible( if( bHasVolume ) { if( ! DataInterpreter::isDataCompatible( - InterpretedData( Sequence< Sequence< Reference< XDataSeries > > >( + { Sequence< Sequence< Reference< XDataSeries > > >( aInterpretedData.Series.getConstArray(), 1 ), - aInterpretedData.Categories ))) + aInterpretedData.Categories })) return false; } diff --git a/chart2/source/model/template/StockDataInterpreter.hxx b/chart2/source/model/template/StockDataInterpreter.hxx index 805c7f8c34b2..4617da5974a9 100644 --- a/chart2/source/model/template/StockDataInterpreter.hxx +++ b/chart2/source/model/template/StockDataInterpreter.hxx @@ -34,14 +34,14 @@ public: protected: // ____ XDataInterpreter ____ - virtual css::chart2::InterpretedData interpretDataSource( + virtual InterpretedData interpretDataSource( const css::uno::Reference< css::chart2::data::XDataSource >& xSource, const css::uno::Sequence< css::beans::PropertyValue >& aArguments, const std::vector< rtl::Reference< ::chart::DataSeries > >& aSeriesToReUse ) override; virtual bool isDataCompatible( - const css::chart2::InterpretedData& aInterpretedData ) override; - virtual css::chart2::InterpretedData reinterpretDataSeries( - const css::chart2::InterpretedData& aInterpretedData ) override; + const InterpretedData& aInterpretedData ) override; + virtual InterpretedData reinterpretDataSeries( + const InterpretedData& aInterpretedData ) override; virtual css::uno::Any getChartTypeSpecificData( const OUString& sKey ) override; diff --git a/chart2/source/model/template/XYDataInterpreter.cxx b/chart2/source/model/template/XYDataInterpreter.cxx index 962ea1008d44..c61088a268f0 100644 --- a/chart2/source/model/template/XYDataInterpreter.cxx +++ b/chart2/source/model/template/XYDataInterpreter.cxx @@ -45,7 +45,7 @@ XYDataInterpreter::~XYDataInterpreter() } // ____ XDataInterpreter ____ -chart2::InterpretedData XYDataInterpreter::interpretDataSource( +InterpretedData XYDataInterpreter::interpretDataSource( const Reference< chart2::data::XDataSource >& xSource, const Sequence< beans::PropertyValue >& aArguments, const std::vector< rtl::Reference< DataSeries > >& aSeriesToReUse ) @@ -130,11 +130,11 @@ chart2::InterpretedData XYDataInterpreter::interpretDataSource( ++nSeriesIndex; } - return InterpretedData( { comphelper::containerToSequence( aSeriesVec ) }, xCategories ); + return { { comphelper::containerToSequence( aSeriesVec ) }, xCategories }; } -chart2::InterpretedData XYDataInterpreter::reinterpretDataSeries( - const chart2::InterpretedData& aInterpretedData ) +InterpretedData XYDataInterpreter::reinterpretDataSeries( + const InterpretedData& aInterpretedData ) { InterpretedData aResult( aInterpretedData ); @@ -218,7 +218,7 @@ chart2::InterpretedData XYDataInterpreter::reinterpretDataSeries( // criterion: all series must have exactly two data::XLabeledDataSequences bool XYDataInterpreter::isDataCompatible( - const chart2::InterpretedData& aInterpretedData ) + const InterpretedData& aInterpretedData ) { const Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series )); for( Reference< XDataSeries > const & dataSeries : aSeries ) diff --git a/chart2/source/model/template/XYDataInterpreter.hxx b/chart2/source/model/template/XYDataInterpreter.hxx index f93f47dba947..56343013da08 100644 --- a/chart2/source/model/template/XYDataInterpreter.hxx +++ b/chart2/source/model/template/XYDataInterpreter.hxx @@ -31,14 +31,14 @@ public: protected: // ____ DataInterpreter ____ - virtual css::chart2::InterpretedData interpretDataSource( + virtual InterpretedData interpretDataSource( const css::uno::Reference< css::chart2::data::XDataSource >& xSource, const css::uno::Sequence< css::beans::PropertyValue >& aArguments, const std::vector< rtl::Reference< ::chart::DataSeries > >& aSeriesToReUse ) override; - virtual css::chart2::InterpretedData reinterpretDataSeries( - const css::chart2::InterpretedData& aInterpretedData ) override; + virtual InterpretedData reinterpretDataSeries( + const InterpretedData& aInterpretedData ) override; virtual bool isDataCompatible( - const css::chart2::InterpretedData& aInterpretedData ) override; + const InterpretedData& aInterpretedData ) override; }; } // namespace chart |