chart2/source/controller/dialogs/DialogModel.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit b70803101f454fce0461650d22d57a6adb5f5a87
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Wed May 10 19:31:23 2023 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Wed May 10 21:44:07 2023 +0200

    tdf#155231: fix CRASH: with embedded OLE chart
    
    First bt:
    6  0x00007f19f96b29b2 in rtl::Reference<chart::Diagram>::operator->() const 
(this=0x55f40881f1f0) at include/rtl/ref.hxx:216
    7  0x00007f19f97b0a03 in chart::DialogModel::isCategoryDiagram() const 
(this=0x55f407cfffb0) at 
/home/julien/lo/libreoffice/chart2/source/controller/dialogs/DialogModel.cxx:656
    8  0x00007f19f983ab1a in chart::DataSourceTabPage::updateControlState() 
(this=0x55f408bdd840) at 
/home/julien/lo/libreoffice/chart2/source/controller/dialogs/tp_DataSource.cxx:439
    9  0x00007f19f983a954 in 
chart::DataSourceTabPage::SeriesSelectionChangedHdl(weld::TreeView&) 
(this=0x55f408bdd840) at 
/home/julien/lo/libreoffice/chart2/source/controller/dialogs/tp_DataSource.cxx:469
    10 0x00007f19f98380e2 in 
chart::DataSourceTabPage::updateControlsFromDialogModel() (this=0x55f408bdd840) 
at 
/home/julien/lo/libreoffice/chart2/source/controller/dialogs/tp_DataSource.cxx:313
    see full bt here:
    https://bugs.documentfoundation.org/attachment.cgi?id=187190
    
    Second part bt:
    6  0x00007fc66e0b29b2 in rtl::Reference<chart::Diagram>::operator->() const 
(this=0x7ffce5f5c9b0) at include/rtl/ref.hxx:216
    7  0x00007fc66e1b00d8 in chart::DialogModel::getCategories() const 
(this=0x5590bff92f10) at 
/home/julien/lo/libreoffice/chart2/source/controller/dialogs/DialogModel.cxx:601
    8  0x00007fc66e1b0474 in chart::DialogModel::getCategoriesRange() const 
(this=0x5590bff92f10) at 
/home/julien/lo/libreoffice/chart2/source/controller/dialogs/DialogModel.cxx:637
    9  0x00007fc66e238141 in 
chart::DataSourceTabPage::updateControlsFromDialogModel() (this=0x5590c00c4030) 
at 
/home/julien/lo/libreoffice/chart2/source/controller/dialogs/tp_DataSource.cxx:316
    
    Regression from:
    commit 5a4b75dcb5abc2e925870614a28e1c2876df8ed9 (patch)
    tree 5fe1f89c70f9c6d90d3eea8f9eb9a68e91f2dec0
    parent dab0d4e1f36faace21145a51733bd3a946992624 (diff)
    use more concrete types in chart2, Diagram
    
    Change-Id: I4332a237248c5acacab7180733d502f049aead96
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151642
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/chart2/source/controller/dialogs/DialogModel.cxx 
b/chart2/source/controller/dialogs/DialogModel.cxx
index 032ec26dc912..9458f82bb13d 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -598,7 +598,8 @@ uno::Reference< chart2::data::XLabeledDataSequence > 
DialogModel::getCategories(
         if( m_xChartDocument.is())
         {
             rtl::Reference< Diagram > xDiagram( 
m_xChartDocument->getFirstChartDiagram());
-            xResult = xDiagram->getCategories();
+            if (xDiagram.is())
+                xResult = xDiagram->getCategories();
         }
     }
     catch( const uno::Exception & )
@@ -652,7 +653,7 @@ OUString DialogModel::getCategoriesRange() const
 bool DialogModel::isCategoryDiagram() const
 {
     bool bRet = false;
-    if( m_xChartDocument.is())
+    if( m_xChartDocument.is() && m_xChartDocument->getFirstChartDiagram())
         bRet = m_xChartDocument->getFirstChartDiagram()->isCategory();
     return bRet;
 }

Reply via email to