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

Stephan Bergmann sbergman at redhat.com
Tue Oct 25 11:11:44 UTC 2016


 chart2/source/controller/sidebar/ChartElementsPanel.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 022f5998094a16cc33f5ac1b2acb031f852ca140
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Oct 21 18:00:03 2016 +0200

    Avoid further crash with empty Chart document
    
    following up on 8b5f8c26f007c8e67bc46b1b09340cae660d0b8b "Avoid crash with empty
    Chart document", when you then close the Writer doc (discarding the changes), it
    crashes in a chart::sidebar::ChartSidebarModifyListener::disposing call whose
    mpParent (that was a ChartElementsPanel) is already destroyed.  The problem is
    that the ChartElementsPanel ctor creates an mxListener pointing to this, then
    calls Initialize, which calls xBroadcaster->addModifyListener(mxListener) and
    then, during updateData, throws a RuntimeException when xDiagram is null in
    getChartType, causing the ChartElementsPanel object to immediately be destroyed,
    but the listener still registered.  This apparently needs fixing independently
    of the immediate problem.  (The immediate problem is a regression introduced
    with d7748842e96536daeb0c638c6f8d01d99b9a3e08 "hide grid and axes options in
    chart elements if not supported, tdf#94297".)
    
    Change-Id: I2fe4f2a59600664f6210456c65e033f9453f4cc9
    (cherry picked from commit 429e4dc671f03e0c4d50e8f8aa055f4aaca761da)
    Reviewed-on: https://gerrit.libreoffice.org/30147
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 1e52f24..e1d3d1f 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -392,6 +392,9 @@ css::uno::Reference<css::chart2::XChartType> getChartType(const css::uno::Refere
 {
     css::uno::Reference<css::chart2::XChartDocument> xChartDoc(xModel, css::uno::UNO_QUERY_THROW);
     css::uno::Reference<chart2::XDiagram > xDiagram = xChartDoc->getFirstDiagram();
+    if (!xDiagram.is()) {
+        return css::uno::Reference<css::chart2::XChartType>();
+    }
 
     css::uno::Reference<css::chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, css::uno::UNO_QUERY_THROW );
 


More information about the Libreoffice-commits mailing list