summaryrefslogtreecommitdiff
path: root/reportdesign/source/filter
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-08-25 13:59:39 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-08-26 17:54:59 +0200
commit146f0e4ce15b48c6914fa310e805ef45a50ab6eb (patch)
tree07af1947990c0240f0bb3ea385048ccc79b9dc0e /reportdesign/source/filter
parent0ab3f09011e4c4c1b85dda72f81f252899162ab5 (diff)
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.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'reportdesign/source/filter')
-rw-r--r--reportdesign/source/filter/xml/xmlExport.cxx9
1 files changed, 6 insertions, 3 deletions
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;