diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-06-22 13:01:52 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-06-23 10:05:29 +0200 |
commit | 9a03e2b5ed80ff4f50ff3cc85fd75e32fe42b3f1 (patch) | |
tree | bdbf6e54bf13bb0dba71e012e0ddf954abe6b07d /chart2 | |
parent | 05f2af8f8251d53ac8e6937759f7bf4d8c8f10e1 (diff) |
tdf#149204 revert getSeriesNames method to the original behaviour
The VSeriesPlotter::getSeriesNames returned a filtered list of
series names without the z-axis names, which is not expected from
the name, so when refactoring the assumption was to return all of
them names. This wasn't correct and has broken rendering of some
charts. This change reverts the method to the original behaviour.
Change-Id: I42464495a1a2b68a34efbc8409ae6c1417ff072d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136280
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit c5c1cbe485b2a24e5964c3e09e8d654e7dfe42c3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136249
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/charttypes/VSeriesPlotter.cxx | 21 | ||||
-rw-r--r-- | chart2/source/view/inc/VSeriesPlotter.hxx | 4 |
2 files changed, 18 insertions, 7 deletions
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 50ee67dd473b..640abfebb1ab 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -2316,20 +2316,29 @@ std::vector<VDataSeries*> VSeriesPlotter::getAllSeries() return aAllSeries; } -uno::Sequence< OUString > VSeriesPlotter::getSeriesNames() const +uno::Sequence<OUString> VSeriesPlotter::getSeriesNames() const { std::vector<OUString> aRetVector; OUString aRole; - if( m_xChartTypeModel.is() ) + if (m_xChartTypeModel.is()) aRole = m_xChartTypeModel->getRoleOfSequenceForSeriesLabel(); - for (VDataSeries const* pSeries : getAllSeries()) + for (auto const& rGroup : m_aZSlots) { - if (pSeries) + if (!rGroup.empty()) { - OUString aSeriesName( DataSeriesHelper::getDataSeriesLabel( pSeries->getModel(), aRole ) ); - aRetVector.push_back( aSeriesName ); + VDataSeriesGroup const & rSeriesGroup(rGroup[0]); + if (!rSeriesGroup.m_aSeriesVector.empty()) + { + VDataSeries const * pSeries = rSeriesGroup.m_aSeriesVector[0].get(); + rtl::Reference< DataSeries > xSeries( pSeries ? pSeries->getModel() : nullptr ); + if( xSeries.is() ) + { + OUString aSeriesName( DataSeriesHelper::getDataSeriesLabel( xSeries, aRole ) ); + aRetVector.push_back( aSeriesName ); + } + } } } return comphelper::containerToSequence( aRetVector ); diff --git a/chart2/source/view/inc/VSeriesPlotter.hxx b/chart2/source/view/inc/VSeriesPlotter.hxx index 90a73f1ee504..ac911be46120 100644 --- a/chart2/source/view/inc/VSeriesPlotter.hxx +++ b/chart2/source/view/inc/VSeriesPlotter.hxx @@ -234,8 +234,10 @@ public: void setExplicitCategoriesProvider( ExplicitCategoriesProvider* pExplicitCategoriesProvider ); + ExplicitCategoriesProvider* getExplicitCategoriesProvider() { return m_pExplicitCategoriesProvider; } + //get series names for the z axis labels - css::uno::Sequence< OUString > getSeriesNames() const; + css::uno::Sequence<OUString> getSeriesNames() const; void setPageReferenceSize( const css::awt::Size & rPageRefSize ); //better performance for big data |