sw/source/writerfilter/dmapper/DomainMapper.cxx | 4 ++-- sw/source/writerfilter/dmapper/SettingsTable.cxx | 9 +++++---- sw/source/writerfilter/dmapper/TableManager.cxx | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-)
New commits: commit eedda19d84dde8f284b4e296bda5208503bf2a7c Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed Apr 16 12:27:42 2025 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Apr 16 14:01:45 2025 +0200 crashtesting: check getValue() According to sw/source/writerfilter/inc/dmapper/resourcemodel.hxx:384 Returns value of the SPRM. Returns nullptr if the internal value is nullptr. Seen in https://shorturl.at/KVBYr Change-Id: Icfe015c8f39a3dc26ee1cd38c61c1956d562ee68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184263 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx b/sw/source/writerfilter/dmapper/DomainMapper.cxx index cc60a6e4285d..302ffdce589d 100644 --- a/sw/source/writerfilter/dmapper/DomainMapper.cxx +++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx @@ -1582,8 +1582,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) //needed for page properties SectionPropertyMap * pSectionContext = m_pImpl->GetSectionContext(); const Value* pValue = rSprm.getValue(); - sal_Int32 nIntValue = pValue->getInt(); - const OUString sStringValue = pValue->getString(); + sal_Int32 nIntValue = (pValue ? pValue->getInt() : 0); + OUString sStringValue = pValue ? pValue->getString() : OUString(); switch(nSprmId) { diff --git a/sw/source/writerfilter/dmapper/SettingsTable.cxx b/sw/source/writerfilter/dmapper/SettingsTable.cxx index 2a9aa15b87ed..dac540a22272 100644 --- a/sw/source/writerfilter/dmapper/SettingsTable.cxx +++ b/sw/source/writerfilter/dmapper/SettingsTable.cxx @@ -259,7 +259,8 @@ void SettingsTable::lcl_sprm(Sprm& rSprm) sal_uInt32 nSprmId = rSprm.getId(); const Value* pValue = rSprm.getValue(); - sal_Int32 nIntValue = pValue->getInt(); + sal_Int32 nIntValue = (pValue ? pValue->getInt() : 0); + OUString sStringValue = pValue ? pValue->getString() : OUString(); switch(nSprmId) { @@ -297,10 +298,10 @@ void SettingsTable::lcl_sprm(Sprm& rSprm) case NS_ooxml::LN_CT_Settings_doNotIncludeSubdocsInStats: // 92554; // Do Not Include Content in Text Boxes, Footnotes, and Endnotes in Document Statistics) break; case NS_ooxml::LN_CT_Settings_decimalSymbol: // 92562; - m_pImpl->m_sDecimalSymbol = pValue->getString(); + m_pImpl->m_sDecimalSymbol = sStringValue; break; case NS_ooxml::LN_CT_Settings_listSeparator: // 92563; - m_pImpl->m_sListSeparator = pValue->getString(); + m_pImpl->m_sListSeparator = sStringValue; break; case NS_ooxml::LN_CT_Settings_rsids: // 92549; revision save Ids - probably not necessary break; @@ -355,7 +356,7 @@ void SettingsTable::lcl_sprm(Sprm& rSprm) case NS_ooxml::LN_CT_MailMerge_query: { // try to get the "database.table" name from the query saved previously - OUString sVal = pValue->getString(); + OUString sVal = sStringValue; if ( sVal.endsWith("$") && sVal.indexOf(".dbo.") > 0 ) { sal_Int32 nSpace = sVal.lastIndexOf(' '); diff --git a/sw/source/writerfilter/dmapper/TableManager.cxx b/sw/source/writerfilter/dmapper/TableManager.cxx index e4b38033475c..2c814d1f6134 100644 --- a/sw/source/writerfilter/dmapper/TableManager.cxx +++ b/sw/source/writerfilter/dmapper/TableManager.cxx @@ -265,8 +265,8 @@ bool TableManager::sprm(Sprm& rSprm) case NS_ooxml::LN_tblDepth: { const Value* pValue = rSprm.getValue(); - - cellDepth(pValue->getInt()); + sal_Int32 nIntValue = pValue ? pValue->getInt() : 0; + cellDepth(nIntValue); } break; case NS_ooxml::LN_inTbl: