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 4389b16f144b968d770acafb1e0f9b6a395e0e63
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Wed Apr 16 12:27:42 2025 +0200
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Wed Apr 23 16:34:07 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>
    (cherry picked from commit eedda19d84dde8f284b4e296bda5208503bf2a7c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184272
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/sw/source/writerfilter/dmapper/DomainMapper.cxx 
b/sw/source/writerfilter/dmapper/DomainMapper.cxx
index ef9aaca77f5e..1cc90c61e9a4 100644
--- a/sw/source/writerfilter/dmapper/DomainMapper.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapper.cxx
@@ -1543,8 +1543,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 cba9292e93d3..be728474b577 100644
--- a/sw/source/writerfilter/dmapper/SettingsTable.cxx
+++ b/sw/source/writerfilter/dmapper/SettingsTable.cxx
@@ -257,7 +257,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)
     {
@@ -295,10 +296,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;
@@ -353,7 +354,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 f73d61b145ac..6f16d9e0c01e 100644
--- a/sw/source/writerfilter/dmapper/TableManager.cxx
+++ b/sw/source/writerfilter/dmapper/TableManager.cxx
@@ -261,8 +261,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:

Reply via email to