editeng/source/editeng/impedit5.cxx | 5 +++-- reportdesign/source/filter/xml/xmlExport.cxx | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-)
New commits: commit 2714d479f529d9e7b103cef860060643816cdae3 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Fri Aug 25 14:22:43 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Sep 6 15:17:41 2023 +0200 editeng: fix crash in EditDoc::FindAttribs check pNode before calling EditDoc::FindAttribs. This is the only place where EditDoc::FindAttribs is called from See https://crashreport.libreoffice.org/stats/signature/EditDoc::FindAttribs(ContentNode%20*,long,long,SfxItemSet%20&) Change-Id: I3ed0724b1113965c09c66413987bb85777ec9a16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156097 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> (cherry picked from commit 8bb505d3e16deed2c7bb5636cfd765013ec23965) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156130 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 2ba71e99111f0d73a584c344c4d4659cebad4f81) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156380 Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> Reviewed-by: Hossein <hoss...@libreoffice.org> Tested-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index 3a87c4b5bfb7..27656ea3dc66 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -316,7 +316,7 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, EditEngineAttribs nOnl for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { ContentNode* pNode = aEditDoc.GetObject( nNode ); - DBG_ASSERT( aEditDoc.GetObject( nNode ), "Node not found: GetAttrib" ); + assert( pNode && "Node not found: GetAttrib" ); const sal_Int32 nStartPos = nNode==nStartNode ? aSel.Min().GetIndex() : 0; const sal_Int32 nEndPos = nNode==nEndNode ? aSel.Max().GetIndex() : pNode->Len(); // Can also be == nStart! @@ -327,7 +327,8 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, EditEngineAttribs nOnl // 2) Examine Style and paragraph attributes only when OFF... // First the very hard formatting... - EditDoc::FindAttribs( pNode, nStartPos, nEndPos, aCurSet ); + if (pNode) + EditDoc::FindAttribs( pNode, nStartPos, nEndPos, aCurSet ); if( nOnlyHardAttrib != EditEngineAttribs::OnlyHard ) { commit 2bf9d7706cbdb2457e7f43a8d1afac557829974c Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Fri Aug 25 13:59:39 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Sep 6 15:17:35 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/+/156132 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit 9ac4655f5b380b84ff056ec7c420eae138fbe618) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156141 Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> Reviewed-by: Hossein <hoss...@libreoffice.org> Tested-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> 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;