From 91fe6b97952aa6f7cef58327fd085a17db38ad95 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 11:44:47 +0200 Subject: Merging upstream version 4:24.2.2. Signed-off-by: Daniel Baumann --- chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx | 10 ++++++++++ chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx | 11 ++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'chart2/source/controller/chartapiwrapper') diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx index 84b98f0d80..7988ef90df 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx @@ -121,6 +121,11 @@ struct lcl_AllOperator : public lcl_Operator virtual bool setsCategories( bool /*bDataInColumns*/ ) override { + // Do not force creation of categories, when original has no categories + if (auto pDataWrapper = dynamic_cast(m_xDataToApply.get())) + if (auto xChartModel = pDataWrapper->getChartModel()) + if (auto xDiagram = xChartModel->getFirstChartDiagram()) + return xDiagram->getCategories().is(); return true; } @@ -698,6 +703,11 @@ css::uno::Sequence< OUString > SAL_CALL ChartDataWrapper::getSupportedServiceNam }; } +rtl::Reference ChartDataWrapper::getChartModel() const +{ + return m_spChart2ModelContact->getDocumentModel(); +} + } // namespace chart /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx index 3c6602d4e0..9a44e53b8b 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx +++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx @@ -20,6 +20,8 @@ #include #include +#include + #include #include #include @@ -28,7 +30,11 @@ #include -namespace chart::wrapper +namespace chart +{ +class ChartModel; + +namespace wrapper { class Chart2ModelContact; @@ -53,6 +59,8 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; + rtl::Reference getChartModel() const; + private: // ____ XDateCategories ____ virtual css::uno::Sequence< double > SAL_CALL getDateCategories() override; @@ -113,5 +121,6 @@ private: }; } // namespace chart::wrapper +} // namespace chart /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3