framework/source/accelerators/storageholder.cxx     |    4 +---
 framework/source/inc/accelerators/storageholder.hxx |    5 +++--
 sc/source/filter/oox/worksheethelper.cxx            |   16 ++++++++++------
 3 files changed, 14 insertions(+), 11 deletions(-)

New commits:
commit d0829662d57fe57cb66abced3d563c227d5bcb79
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Aug 18 12:05:40 2025 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Aug 18 18:02:15 2025 +0200

    add a constructor to TStorageInfo
    
    Change-Id: I74cd5c9a82976e5cfb31fe622db543e8133bfee1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189863
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/framework/source/accelerators/storageholder.cxx 
b/framework/source/accelerators/storageholder.cxx
index 4dfda35efadb..bf735d36d859 100644
--- a/framework/source/accelerators/storageholder.cxx
+++ b/framework/source/accelerators/storageholder.cxx
@@ -131,9 +131,7 @@ css::uno::Reference< css::embed::XStorage > 
StorageHolder::openPath(const OUStri
                 }
 
             std::unique_lock g(m_mutex);
-            TStorageInfo aInfo;
-            aInfo.Storage  = xChild;
-            aInfo.UseCount = 1;
+            TStorageInfo aInfo(xChild);
             m_lStorages.emplace(sCheckPath, std::move(aInfo));
         }
 
diff --git a/framework/source/inc/accelerators/storageholder.hxx 
b/framework/source/inc/accelerators/storageholder.hxx
index 355bedeaa662..4e4a66183dd0 100644
--- a/framework/source/inc/accelerators/storageholder.hxx
+++ b/framework/source/inc/accelerators/storageholder.hxx
@@ -50,8 +50,9 @@ class StorageHolder final
                 sal_Int32 UseCount;
                 TStorageListenerList Listener;
 
-                TStorageInfo()
-                    : UseCount(0)
+                TStorageInfo(css::uno::Reference<css::embed::XStorage> 
xStorage)
+                    : Storage(std::move(xStorage))
+                    , UseCount(1)
                 {}
         };
 
commit d4ab276bcd100f96d018b9c4ec84e886691234b8
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Aug 17 20:24:14 2025 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Aug 18 18:02:05 2025 +0200

    null deref of StyleSheetPool seen
    
     #0  0x00007fca2fa09df2 in std::__shared_ptr<svl::IndexedStyleSheets, 
(__gnu_cxx::_Lock_policy)2>::get (this=<optimized out>)
         at 
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/shared_ptr_base.h:1665
     #1  std::__shared_ptr_access<svl::IndexedStyleSheets, 
(__gnu_cxx::_Lock_policy)2, false, false>::_M_get (this=<optimized out>)
         at 
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/shared_ptr_base.h:1363
     #2  std::__shared_ptr_access<svl::IndexedStyleSheets, 
(__gnu_cxx::_Lock_policy)2, false, false>::operator-> (
         this=<optimized out>) at 
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/shared_ptr_base.h:1357
     #3  SfxStyleSheetIterator::Find(rtl::OUString const&) () at 
svl/source/items/style.cxx:525
     #4  0x00007fca2fa0b406 in SfxStyleSheetBasePool::Find(rtl::OUString 
const&, SfxStyleFamily, SfxStyleSearchBits) [clone .localalias] () at 
svl/source/items/style.cxx:722
     #5  0x00007fca1f228c76 in oox::xls::CellStyle::createCellStyle() ()
         at include/unotools/resmgr.hxx:41
     #6  0x00007fca1f229c11 in oox::xls::CellStyleBuffer::createCellStyle (
         rxCellStyle=std::shared_ptr<oox::xls::CellStyle> (use count 3, weak 
count 0) = {...})
         at sc/source/filter/oox/stylesbuffer.cxx:2804
     #7  oox::xls::CellStyleBuffer::getDefaultStyleName (this=0x3c4ea458)
         at sc/source/filter/oox/stylesbuffer.cxx:2759
     #8  oox::xls::StylesBuffer::getDefaultStyleName (this=0x3c4ea350)
         at sc/source/filter/oox/stylesbuffer.cxx:3008
     #9  0x00007fca1f26c762 in 
oox::xls::WorksheetGlobals::initializeWorksheetImport() ()
         at sc/source/filter/oox/worksheethelper.cxx:923
     #10 0x00007fca1f26c7dd in 
oox::xls::WorksheetHelper::initializeWorksheetImport 
(this=this@entry=0x3c594168)
         at sc/source/filter/oox/worksheethelper.cxx:1614
     #11 0x00007fca1f262e34 in oox::xls::WorksheetFragment::initializeImport() 
()
        at sc/source/filter/oox/worksheetfragment.cxx:616
    
    Change-Id: I5bc25e361da17b811af4e552ca74b4becf0181ca
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189832
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/sc/source/filter/oox/worksheethelper.cxx 
b/sc/source/filter/oox/worksheethelper.cxx
index a7bf39b6cfb9..3b24f22a81ab 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -905,12 +905,16 @@ void WorksheetGlobals::initializeWorksheetImport()
     // set default cell style for unused cells
     ScDocumentImport& rDoc = getDocImport();
 
-    ScStyleSheet* pStyleSheet =
-        static_cast<ScStyleSheet*>(rDoc.getDoc().GetStyleSheetPool()->Find(
-            getStyles().getDefaultStyleName(), SfxStyleFamily::Para));
-
-    if (pStyleSheet)
-        rDoc.setCellStyleToSheet(getSheetIndex(), *pStyleSheet);
+    ScStyleSheetPool* pStylePool = rDoc.getDoc().GetStyleSheetPool();
+    SAL_WARN_IF(!pStylePool, "sc.filter", "Unusual lack of style pool");
+    if (pStylePool)
+    {
+        ScStyleSheet* pStyleSheet =
+            static_cast<ScStyleSheet*>(pStylePool->Find(
+                getStyles().getDefaultStyleName(), SfxStyleFamily::Para));
+        if (pStyleSheet)
+            rDoc.setCellStyleToSheet(getSheetIndex(), *pStyleSheet);
+    }
 
     /*  Remember the current sheet index in global data, needed by global
         objects, e.g. the chart converter. */

Reply via email to