[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - chart2/source

Balazs Varga (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 29 07:25:00 UTC 2021


 chart2/source/controller/sidebar/ChartSeriesPanel.cxx |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 768acbf0e74dd93714a7e5421f3cff69a45de632
Author:     Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Fri Jun 11 12:22:53 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Jun 29 09:24:28 2021 +0200

    tdf#142793 chart UI: fix option "Secondary Y Axis" on sidebar
    
    Attaching a data series to the secondary axis didn't enable
    the secondary axis at the right side of the chart using the
    sidebar (unlike in data series local menu -> Format Data
    Series... -> Options).
    
    Test: Click on the chart, select one of the data series, and
    enable Data Series -> Align Series to Axis -> Secondary Y Axis.
    
    Change-Id: I2cb99458af724471d4d04cac8c2c9013f41634fe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117048
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit 3af7001d0a04fdbcb38a35d0841d7d186beeb57f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117729
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
index 0550463e4d3c..4e48afa4ac41 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
@@ -34,9 +34,12 @@
 #include <ChartController.hxx>
 
 #include <DataSeriesHelper.hxx>
+#include <DiagramHelper.hxx>
 #include <RegressionCurveHelper.hxx>
 #include <StatisticsHelper.hxx>
 
+#include <comphelper/processfactory.hxx>
+
 using namespace css;
 using namespace css::uno;
 
@@ -212,14 +215,14 @@ bool isPrimaryAxis(const css::uno::Reference<css::frame::XModel>&
 void setAttachedAxisType(const css::uno::Reference<css::frame::XModel>&
         xModel, const OUString& rCID, bool bPrimary)
 {
-    css::uno::Reference< css::beans::XPropertySet > xSeries(
-        ObjectIdentifier::getDataSeriesForCID(rCID, xModel), uno::UNO_QUERY );
+    const uno::Reference<chart2::XDataSeries>& xDataSeries = ObjectIdentifier::getDataSeriesForCID(rCID, xModel);
 
-    if (!xSeries.is())
+    if (!xDataSeries.is())
         return;
 
-    sal_Int32 nIndex = bPrimary ? 0 : 1;
-    xSeries->setPropertyValue("AttachedAxisIndex", css::uno::Any(nIndex));
+    uno::Reference<chart2::XChartDocument> xChartDoc(xModel, css::uno::UNO_QUERY);
+    uno::Reference<chart2::XDiagram> xDiagram = xChartDoc->getFirstDiagram();
+    DiagramHelper::attachSeriesToAxis(bPrimary, xDataSeries, xDiagram, comphelper::getProcessComponentContext());
 }
 
 css::uno::Reference<css::chart2::XChartType> getChartType(


More information about the Libreoffice-commits mailing list