writerfilter/source/dmapper/DomainMapper.cxx | 2 - writerfilter/source/dmapper/DomainMapper_Impl.cxx | 25 ++++++++++++++++------ writerfilter/source/dmapper/StyleSheetTable.cxx | 2 - 3 files changed, 21 insertions(+), 8 deletions(-)
New commits: commit 83a235450e6bf3c671ab9a1710e92a356d4d2052 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Sun Jul 11 13:02:07 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sun Jul 11 16:44:11 2021 +0200 ofz#36037 Revert "pProperties in StyleSheetEntry is never nullptr" This reverts commit a7eb2f57d8e586577679ecd085b9aa90746ec36b. Reason for revert: tut tut, appears I was wrong Change-Id: Ie21db35d7809c2bc3d71c8231bf13bbdc0415b5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118716 Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 0675d62ae22f..39b118e108f0 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2732,7 +2732,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) if( !sStyleName.isEmpty() && GetStyleSheetTable() ) pStyle = GetStyleSheetTable()->FindStyleSheetByConvertedStyleName( sStyleName ); - if( pStyle + if( pStyle && pStyle->pProperties && pStyle->pProperties->isSet(PROP_BREAK_TYPE) && pStyle->pProperties->getProperty(PROP_BREAK_TYPE)->second == aBreakType ) { diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index f80f73ffdd7b..1ab11e0b149f 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -128,6 +128,8 @@ static void lcl_linenumberingHeaderFooter( const uno::Reference<container::XName if (!pEntry) return; const StyleSheetPropertyMap* pStyleSheetProperties = pEntry->pProperties.get(); + if ( !pStyleSheetProperties ) + return; sal_Int32 nListId = pStyleSheetProperties->GetListId(); if( xStyles.is() ) { @@ -910,14 +912,17 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId, StyleShee { while(pEntry) { - std::optional<PropertyMap::Property> aProperty = - pEntry->pProperties->getProperty(eId); - if( aProperty ) + if(pEntry->pProperties) { - if (pIsDocDefault) - *pIsDocDefault = pEntry->pProperties->isDocDefault(eId); + std::optional<PropertyMap::Property> aProperty = + pEntry->pProperties->getProperty(eId); + if( aProperty ) + { + if (pIsDocDefault) + *pIsDocDefault = pEntry->pProperties->isDocDefault(eId); - return aProperty->second; + return aProperty->second; + } } //search until the property is set or no parent is available StyleSheetEntryPtr pNewEntry; @@ -1200,6 +1205,8 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) if ( pParaStyle ) { const StyleSheetPropertyMap* pStyleProperties = pParaStyle->pProperties.get(); + if (!pStyleProperties) + return; sal_Int32 nWidth = rAppendContext.pLastParagraphProperties->Getw() > 0 ? rAppendContext.pLastParagraphProperties->Getw() : @@ -1418,6 +1425,8 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) static sal_Int32 lcl_getListId(const StyleSheetEntryPtr& rEntry, const StyleSheetTablePtr& rStyleTable, bool & rNumberingFromBaseStyle) { const StyleSheetPropertyMap* pEntryProperties = rEntry->pProperties.get(); + if (!pEntryProperties) + return -1; sal_Int32 nListId = pEntryProperties->GetListId(); // The style itself has a list id. @@ -1457,6 +1466,8 @@ sal_Int16 DomainMapper_Impl::GetListLevel(const StyleSheetEntryPtr& pEntry, return -1; const StyleSheetPropertyMap* pEntryProperties = pEntry->pProperties.get(); + if (!pEntryProperties) + return -1; nListLevel = pEntryProperties->GetListLevel(); // The style itself has a list level. @@ -7602,6 +7613,8 @@ uno::Reference<container::XIndexAccess> DomainMapper_Impl::GetCurrentNumberingRu if (!pEntry) return xRet; const StyleSheetPropertyMap* pStyleSheetProperties = pEntry->pProperties.get(); + if (!pStyleSheetProperties) + return xRet; sal_Int32 nListId = pStyleSheetProperties->GetListId(); if (nListId < 0) return xRet; diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 0636c87589b1..ae9440be8381 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -1004,7 +1004,7 @@ void StyleSheetTable::ApplyStyleSheets( const FontTablePtr& rFontTable ) xStyle.set(xStyles->getByName(sConvertedStyleName), uno::UNO_QUERY_THROW); StyleSheetPropertyMap* pPropertyMap = pEntry->pProperties.get(); - if (pPropertyMap->GetListId() == -1) + if (pPropertyMap && pPropertyMap->GetListId() == -1) { // No properties? Word default is 'none', Writer one is 'arabic', handle this. uno::Reference<beans::XPropertySet> xPropertySet(xStyle, uno::UNO_QUERY_THROW); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits