sw/source/core/docnode/ndtbl.cxx   |    3 ++-
 sw/source/ui/table/convert.cxx     |    2 +-
 sw/source/ui/table/instable.cxx    |    2 +-
 sw/source/ui/table/tautofmt.cxx    |    3 ++-
 sw/source/uibase/shells/basesh.cxx |    2 +-
 5 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit ade62c00c34cb23897f84c79df2d347a5eebd86a
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri May 30 20:06:57 2025 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue Jun 10 13:22:06 2025 +0200

    use shallow copy of default AutoFormatTable
    
    Change-Id: I958f0b6329c4d55af61a94e641bd328abe08dad7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186056
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index c264ee64b016..7f824ec88feb 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -50,6 +50,7 @@
 #include <cntfrm.hxx>
 #include <pam.hxx>
 #include <swcrsr.hxx>
+#include <swmodule.hxx>
 #include <swtable.hxx>
 #include <swundo.hxx>
 #include <tblsel.hxx>
@@ -3962,7 +3963,7 @@ bool SwDoc::GetTableAutoFormat( const SwSelBoxes& rBoxes, 
SwTableAutoFormat& rGe
 SwTableAutoFormatTable& SwDoc::GetTableStyles()
 {
     if (!m_pTableStyles)
-        m_pTableStyles.reset(new SwTableAutoFormatTable);
+        m_pTableStyles.reset(new 
SwTableAutoFormatTable(SwModule::get()->GetAutoFormatTable()));
     return *m_pTableStyles;
 }
 
diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx
index 2bc60a866736..6af9af01a659 100644
--- a/sw/source/ui/table/convert.cxx
+++ b/sw/source/ui/table/convert.cxx
@@ -102,7 +102,7 @@ SwConvertTableDlg::SwConvertTableDlg(SwView& rView, bool 
bToTable)
     , m_nIndex(0)
     , m_nDfltStylePos(0)
     , m_bCoreDataChanged(false)
-    , m_xTableTable(new SwTableAutoFormatTable)
+    , m_xTableTable(new 
SwTableAutoFormatTable(SwModule::get()->GetAutoFormatTable()))
     , m_xTabBtn(m_xBuilder->weld_radio_button(u"tabs"_ustr))
     , m_xSemiBtn(m_xBuilder->weld_radio_button(u"semicolons"_ustr))
     , m_xParaBtn(m_xBuilder->weld_radio_button(u"paragraph"_ustr))
diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx
index 8c8f4f990344..5b0193fa0736 100644
--- a/sw/source/ui/table/instable.cxx
+++ b/sw/source/ui/table/instable.cxx
@@ -131,7 +131,7 @@ void SwInsTableDlg::InitAutoTableFormat()
 
     m_xLbFormat->connect_changed(LINK(this, SwInsTableDlg, SelFormatHdl));
 
-    m_xTableTable.reset(new SwTableAutoFormatTable);
+    m_xTableTable.reset(new 
SwTableAutoFormatTable(SwModule::get()->GetAutoFormatTable()));
 
     // Add "- none -" style autoformat table.
     m_xLbFormat->append_text(SwViewShell::GetShellRes()->aStrNone); // Insert 
to listbox
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index 482024514ebc..d2c4a7f19a57 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -23,6 +23,7 @@
 #include <sal/log.hxx>
 #include <strings.hrc>
 #include <shellres.hxx>
+#include <swmodule.hxx>
 #include <tautofmt.hxx>
 
 namespace
@@ -66,7 +67,7 @@ SwAutoFormatDlg::SwAutoFormatDlg(weld::Window* pParent, 
SwWrtShell* pWrtShell, b
     , m_nDfltStylePos(0)
     , m_bCoreDataChanged(false)
     , m_bSetAutoFormat(bAutoFormat)
-    , m_xTableTable(new SwTableAutoFormatTable)
+    , m_xTableTable(new 
SwTableAutoFormatTable(SwModule::get()->GetAutoFormatTable()))
     , m_xLbFormat(m_xBuilder->weld_tree_view(u"formatlb"_ustr))
     , m_xBtnNumFormat(m_xBuilder->weld_check_button(u"numformatcb"_ustr))
     , m_xBtnBorder(m_xBuilder->weld_check_button(u"bordercb"_ustr))
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index a411363b18ca..fe28029ff5b4 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -1169,7 +1169,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
                 {
                     OUString sAutoFormat = static_cast< const SfxStringItem* 
>(pItem)->GetValue();
 
-                    pAutoFormatTable.reset(new SwTableAutoFormatTable);
+                    pAutoFormatTable.reset(new 
SwTableAutoFormatTable(SwModule::get()->GetAutoFormatTable()));
 
                     for( sal_uInt16 i = 0, nCount = pAutoFormatTable->size(); 
i < nCount; i++ )
                     {

Reply via email to