chart2/source/view/charttypes/VSeriesPlotter.cxx |   21 +++++++++++++++------
 chart2/source/view/inc/VSeriesPlotter.hxx        |    4 +++-
 2 files changed, 18 insertions(+), 7 deletions(-)

New commits:
commit 9a03e2b5ed80ff4f50ff3cc85fd75e32fe42b3f1
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Wed Jun 22 13:01:52 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Jun 23 10:05:29 2022 +0200

    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 <xiscofa...@libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    (cherry picked from commit c5c1cbe485b2a24e5964c3e09e8d654e7dfe42c3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136249

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

Reply via email to