reportdesign/source/filter/xml/xmlExport.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 146f0e4ce15b48c6914fa310e805ef45a50ab6eb
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Fri Aug 25 13:59:39 2023 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Sat Aug 26 17:54:59 2023 +0200

    reportdesign: fix crash in ORptExport::exportSectionAutoStyle
    
    See 
https://crashreport.libreoffice.org/stats/signature/rptxml::ORptExport::exportSectionAutoStyle(com::sun::star::uno::Reference%3Ccom::sun::star::report::XSection%3E%20const%20&)
    
    Change-Id: Ibe5a6de1888728fba22f8cc0d128dcb04da9ede9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156096
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/reportdesign/source/filter/xml/xmlExport.cxx 
b/reportdesign/source/filter/xml/xmlExport.cxx
index d75828c65939..6e7104724704 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -517,12 +517,12 @@ void ORptExport::exportSectionAutoStyle(const 
Reference<XSection>& _xProp)
     for (i = 0 ; i< nCount ; ++i)
     {
         Reference<XReportComponent> 
xReportElement(_xProp->getByIndex(i),uno::UNO_QUERY);
-        uno::Reference< XShape> xShape(xReportElement,uno::UNO_QUERY);
-        if ( xShape.is() )
-            continue;
         OSL_ENSURE( xReportElement.is(),"NULL Element in Section!" );
         if ( !xReportElement.is() )
             continue;
+        uno::Reference< XShape> xShape(xReportElement,uno::UNO_QUERY);
+        if ( xShape.is() )
+            continue;
         sal_Int32 nX = xReportElement->getPositionX();
         aColumnPos.push_back(nX);
         Reference<XFixedLine> xFixedLine(xReportElement,uno::UNO_QUERY);
@@ -580,6 +580,9 @@ void ORptExport::exportSectionAutoStyle(const 
Reference<XSection>& _xProp)
     for (i = 0 ; i< nCount ; ++i)
     {
         Reference<XReportComponent> 
xReportElement(_xProp->getByIndex(i),uno::UNO_QUERY);
+        OSL_ENSURE( xReportElement.is(),"NULL Element in Section!" );
+        if ( !xReportElement.is() )
+            continue;
         uno::Reference< XShape> xShape(xReportElement,uno::UNO_QUERY);
         if ( xShape.is() )
             continue;

Reply via email to