sw/inc/tblafmt.hxx | 4 ---- sw/source/core/doc/tblafmt.cxx | 30 +++++++++++++++++++++--------- 2 files changed, 21 insertions(+), 13 deletions(-)
New commits: commit d568f5f744f49cecf7c22feca06b18887832d207 Author: Caolán McNamara <[email protected]> AuthorDate: Fri May 30 12:12:36 2025 +0100 Commit: Miklos Vajna <[email protected]> CommitDate: Fri Jun 6 14:26:29 2025 +0200 move Load/Save bodies to SwTableAutoFormatTable::Impl Change-Id: I6f9fdfdcacc91a786857d997748069830e92d222 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186051 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx index 08593f64dccc..fdc85c213132 100644 --- a/sw/inc/tblafmt.hxx +++ b/sw/inc/tblafmt.hxx @@ -275,10 +275,6 @@ class SW_DLLPUBLIC SwTableAutoFormatTable struct Impl; std::unique_ptr<Impl> m_pImpl; - SAL_DLLPRIVATE bool Load( SvStream& rStream ); - SAL_DLLPRIVATE bool Save( SvStream& rStream ) const; - - void Load(); public: explicit SwTableAutoFormatTable(); ~SwTableAutoFormatTable(); diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index fca07def2be9..785e165720ba 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -926,6 +926,13 @@ void SwTableAutoFormat::SetXObject(rtl::Reference<SwXTextTableStyle> const& xObj struct SwTableAutoFormatTable::Impl { std::vector<std::unique_ptr<SwTableAutoFormat>> m_AutoFormats; + + void Load(); + bool Save() const; + +private: + SAL_DLLPRIVATE bool Load(SvStream& rStream); + SAL_DLLPRIVATE bool Save(SvStream& rStream) const; }; size_t SwTableAutoFormatTable::size() const @@ -1035,10 +1042,15 @@ SwTableAutoFormatTable::SwTableAutoFormatTable() pNew->SetUserDefined(false); m_pImpl->m_AutoFormats.push_back(std::move(pNew)); - Load(); + m_pImpl->Load(); } -void SwTableAutoFormatTable::Load() +bool SwTableAutoFormatTable::Save() const +{ + return m_pImpl->Save(); +} + +void SwTableAutoFormatTable::Impl::Load() { if (comphelper::IsFuzzing()) return; @@ -1051,7 +1063,7 @@ void SwTableAutoFormatTable::Load() } } -bool SwTableAutoFormatTable::Save() const +bool SwTableAutoFormatTable::Impl::Save() const { if (comphelper::IsFuzzing()) return false; @@ -1061,7 +1073,7 @@ bool SwTableAutoFormatTable::Save() const return Save( *aStream.GetOutStream() ) && aStream.Commit(); } -bool SwTableAutoFormatTable::Load( SvStream& rStream ) +bool SwTableAutoFormatTable::Impl::Load( SvStream& rStream ) { bool bRet = ERRCODE_NONE == rStream.GetError(); if (bRet) @@ -1121,7 +1133,7 @@ bool SwTableAutoFormatTable::Load( SvStream& rStream ) bRet = pNew->Load( rStream, aVersions ); if( bRet ) { - m_pImpl->m_AutoFormats.push_back(std::move(pNew)); + m_AutoFormats.push_back(std::move(pNew)); } else { @@ -1139,7 +1151,7 @@ bool SwTableAutoFormatTable::Load( SvStream& rStream ) return bRet; } -bool SwTableAutoFormatTable::Save( SvStream& rStream ) const +bool SwTableAutoFormatTable::Impl::Save( SvStream& rStream ) const { bool bRet = ERRCODE_NONE == rStream.GetError(); if (bRet) @@ -1158,12 +1170,12 @@ bool SwTableAutoFormatTable::Save( SvStream& rStream ) const // Write this version number for all attributes SwAfVersions::Write(rStream, AUTOFORMAT_FILE_VERSION); - rStream.WriteUInt16( m_pImpl->m_AutoFormats.size() - 1 ); + rStream.WriteUInt16( m_AutoFormats.size() - 1 ); bRet = ERRCODE_NONE == rStream.GetError(); - for (size_t i = 1; bRet && i < m_pImpl->m_AutoFormats.size(); ++i) + for (size_t i = 1; bRet && i < m_AutoFormats.size(); ++i) { - SwTableAutoFormat const& rFormat = *m_pImpl->m_AutoFormats[i]; + SwTableAutoFormat const& rFormat = *m_AutoFormats[i]; bRet = rFormat.Save(rStream, AUTOFORMAT_FILE_VERSION); } }
