sw/inc/tblafmt.hxx                 |    2 +-
 sw/qa/core/uwriter.cxx             |    6 ------
 sw/source/core/doc/tblafmt.cxx     |    2 ++
 sw/source/core/docnode/ndtbl.cxx   |    3 ---
 sw/source/core/unocore/unotbl.cxx  |    1 -
 sw/source/ui/dbui/dbinsdlg.cxx     |    1 -
 sw/source/ui/table/convert.cxx     |    1 -
 sw/source/ui/table/instable.cxx    |    1 -
 sw/source/ui/table/tautofmt.cxx    |    1 -
 sw/source/uibase/shells/basesh.cxx |    2 --
 10 files changed, 3 insertions(+), 17 deletions(-)

New commits:
commit de44d1c81bda68ddc395fb51ee6a6cd9d36e67dd
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri May 30 11:45:20 2025 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Fri Jun 6 14:00:39 2025 +0200

    SwTableAutoFormatTable ctor is always followed by Load
    
    so call that from the ctor
    
    Change-Id: Ic071be84cedb8b131339030d294bbf4690902ac8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186050
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index c749e9d2f675..08593f64dccc 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -278,6 +278,7 @@ class SW_DLLPUBLIC SwTableAutoFormatTable
     SAL_DLLPRIVATE bool Load( SvStream& rStream );
     SAL_DLLPRIVATE bool Save( SvStream& rStream ) const;
 
+    void Load();
 public:
     explicit SwTableAutoFormatTable();
     ~SwTableAutoFormatTable();
@@ -299,7 +300,6 @@ public:
     /// Find table style with the provided name, return nullptr when not found.
     SwTableAutoFormat* FindAutoFormat(std::u16string_view rName) const;
 
-    void Load();
     bool Save() const;
 };
 
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 9e8364f79dd3..3d9eb589deff 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -1244,12 +1244,6 @@ void SwDocTest::testTableAutoFormats()
     //create new AutoFormatTable
     SwTableAutoFormatTable aLoadTAFT;
 
-    //check the style size
-    CPPUNIT_ASSERT_EQUAL( size_t(1),  aLoadTAFT.size() );
-
-    //load the saved styles
-    aLoadTAFT.Load();
-
     //check the style size after load
     CPPUNIT_ASSERT_EQUAL( size_t(2),  aLoadTAFT.size() );
 
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 20cd4309cd34..fca07def2be9 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -1034,6 +1034,8 @@ SwTableAutoFormatTable::SwTableAutoFormatTable()
 
     pNew->SetUserDefined(false);
     m_pImpl->m_AutoFormats.push_back(std::move(pNew));
+
+    Load();
 }
 
 void SwTableAutoFormatTable::Load()
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 160725e4fc93..c264ee64b016 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -3962,10 +3962,7 @@ bool SwDoc::GetTableAutoFormat( const SwSelBoxes& 
rBoxes, SwTableAutoFormat& rGe
 SwTableAutoFormatTable& SwDoc::GetTableStyles()
 {
     if (!m_pTableStyles)
-    {
         m_pTableStyles.reset(new SwTableAutoFormatTable);
-        m_pTableStyles->Load();
-    }
     return *m_pTableStyles;
 }
 
diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index ce8d4c24f966..7b9832bf74c0 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -2449,7 +2449,6 @@ void SwXTextTable::autoFormat(const OUString& 
sAutoFormatName)
     SwFrameFormat* pFormat = lcl_EnsureCoreConnected(GetFrameFormat(), this);
     SwTable* pTable = lcl_EnsureTableNotComplex(SwTable::FindTable(pFormat), 
this);
     SwTableAutoFormatTable aAutoFormatTable;
-    aAutoFormatTable.Load();
     for (size_t i = aAutoFormatTable.size(); i;)
         if( sAutoFormatName == aAutoFormatTable[ --i ].GetName() )
         {
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 6ecdd3987211..305ba447d8ca 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1708,7 +1708,6 @@ void SwInsertDBColAutoPilot::Load()
             {
                 // then load the AutoFormat file and look for Autoformat first
                 SwTableAutoFormatTable aAutoFormatTable;
-                aAutoFormatTable.Load();
                 for( size_t nAutoFormat = aAutoFormatTable.size(); 
nAutoFormat; )
                     if( sTmp == aAutoFormatTable[ --nAutoFormat ].GetName() )
                     {
diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx
index 32f2d9323acb..2bc60a866736 100644
--- a/sw/source/ui/table/convert.cxx
+++ b/sw/source/ui/table/convert.cxx
@@ -125,7 +125,6 @@ SwConvertTableDlg::SwConvertTableDlg(SwView& rView, bool 
bToTable)
     , m_pShell(&rView.GetWrtShell())
 {
     m_aWndPreview.DetectRTL(&rView.GetWrtShell());
-    m_xTableTable->Load();
 
     const int nWidth = m_xLbFormat->get_approximate_digit_width() * 32;
     const int nHeight = m_xLbFormat->get_height_rows(8);
diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx
index 5a38be0efea9..8c8f4f990344 100644
--- a/sw/source/ui/table/instable.cxx
+++ b/sw/source/ui/table/instable.cxx
@@ -132,7 +132,6 @@ void SwInsTableDlg::InitAutoTableFormat()
     m_xLbFormat->connect_changed(LINK(this, SwInsTableDlg, SelFormatHdl));
 
     m_xTableTable.reset(new SwTableAutoFormatTable);
-    m_xTableTable->Load();
 
     // 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 ca05712486e2..482024514ebc 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -80,7 +80,6 @@ SwAutoFormatDlg::SwAutoFormatDlg(weld::Window* pParent, 
SwWrtShell* pWrtShell, b
     , m_xWndPreview(new weld::CustomWeld(*m_xBuilder, u"preview"_ustr, 
m_aWndPreview))
 {
     m_aWndPreview.DetectRTL(pWrtShell);
-    m_xTableTable->Load();
 
     const int nWidth = m_xLbFormat->get_approximate_digit_width() * 32;
     const int nHeight = m_xLbFormat->get_height_rows(8);
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 3d0447067fc2..1451dc5c8716 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -1170,7 +1170,6 @@ void SwBaseShell::Execute(SfxRequest &rReq)
                     OUString sAutoFormat = static_cast< const SfxStringItem* 
>(pItem)->GetValue();
 
                     pAutoFormatTable.reset(new SwTableAutoFormatTable);
-                    pAutoFormatTable->Load();
 
                     for( sal_uInt16 i = 0, nCount = pAutoFormatTable->size(); 
i < nCount; i++ )
                     {
@@ -3170,7 +3169,6 @@ void SwBaseShell::InsertTable( SfxRequest& _rRequest )
                 if ( !aAutoNameIn.isEmpty() )
                 {
                     SwTableAutoFormatTable aTableTable;
-                    aTableTable.Load();
                     for ( size_t n=0; n<aTableTable.size(); n++ )
                     {
                         if ( aTableTable[n].GetName() == aAutoNameIn )

Reply via email to