reportdesign/source/filter/xml/xmlExport.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
New commits: commit 818d69daae1316c2cee6206972fb5967d5566f44 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Fri Aug 25 13:59:39 2023 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Wed Aug 30 12:47:42 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 (cherry picked from commit 12c0f4e4d1fad69f09d3ff30a65b18a68b817d90) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156133 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit 7775f4d4965b6ab94b18c2e046fd9b2edcabef12) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156149 Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Tested-by: Thorsten Behrens <thorsten.behr...@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index e3bf45249a44..e53da52506e6 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;