bin/find-can-be-private-symbols.functions.results |   16 --
 compilerplugins/clang/unusedmethods.results       |    6 -
 sw/inc/dbgoutsw.hxx                               |    3 
 sw/inc/doc.hxx                                    |    6 -
 sw/inc/frameformats.hxx                           |   91 ---------------
 sw/inc/frmfmt.hxx                                 |    3 
 sw/inc/textboxhelper.hxx                          |    1 
 sw/source/core/doc/dbgoutsw.cxx                   |    6 -
 sw/source/core/doc/docedt.cxx                     |    2 
 sw/source/core/doc/docfmt.cxx                     |  126 ----------------------
 sw/source/core/doc/docglbl.cxx                    |    5 
 sw/source/core/doc/doclay.cxx                     |    2 
 sw/source/core/doc/docnew.cxx                     |    2 
 sw/source/core/inc/frmtool.hxx                    |    1 
 sw/source/core/layout/atrfrm.cxx                  |    9 -
 sw/source/filter/basflt/shellio.cxx               |    2 
 sw/source/uibase/app/docstyle.cxx                 |    6 -
 17 files changed, 19 insertions(+), 268 deletions(-)

New commits:
commit 1dc1595824509c58f86f819673719096f771f417
Author:     Bjoern Michaelsen <[email protected]>
AuthorDate: Sun Apr 16 14:06:24 2023 +0200
Commit:     Bjoern Michaelsen <[email protected]>
CommitDate: Mon May 1 20:51:02 2023 +0200

    replace SwFrameFormats with sw::FrameFormats<SwFrameFormat*>
    
    - SwFrameFormats is now completely replaced by stronger typed
      sw::FrameFormats<>, thus remove it
    
    Change-Id: I7e655a83ba8cf01d1e68dccd1804c167e8daca9c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150455
    Tested-by: Jenkins
    Reviewed-by: Bjoern Michaelsen <[email protected]>

diff --git a/bin/find-can-be-private-symbols.functions.results 
b/bin/find-can-be-private-symbols.functions.results
index 1acff353035d..e3cb6f130544 100644
--- a/bin/find-can-be-private-symbols.functions.results
+++ b/bin/find-can-be-private-symbols.functions.results
@@ -13279,21 +13279,6 @@ SwFrameFormat::dumpAsXml(_xmlTextWriter*) const
 SwFrameFormat::getSdrAllFillAttributesHelper() const
 SwFrameFormat::supportsFullDrawingLayerFillAttributeSet() const
 SwFrameFormat::~SwFrameFormat()
-SwFrameFormats::ContainsFormat(SwFrameFormat const&) const
-SwFrameFormats::DeleteAndDestroyAll(bool)
-SwFrameFormats::FindFormatByName(rtl::OUString const&) const
-SwFrameFormats::IsAlive(SwFrameFormat const*) const
-SwFrameFormats::SwFrameFormats()
-SwFrameFormats::dumpAsXml(_xmlTextWriter*, char const*) const
-SwFrameFormats::erase(SwFrameFormat* const&)
-SwFrameFormats::erase(boost::multi_index::detail::rnd_node_iterator<boost::multi_index::detail::random_access_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy,
 boost::multi_index::detail::index_node_base<SwFrameFormat*, 
std::allocator<SwFrameFormat*> > > > > const&)
-SwFrameFormats::erase(unsigned long)
-SwFrameFormats::findByTypeAndName(unsigned short, rtl::OUString const&) const
-SwFrameFormats::findRangeByName(rtl::OUString const&) const
-SwFrameFormats::newDefault(SwFrameFormat* const&)
-SwFrameFormats::newDefault(boost::multi_index::detail::rnd_node_iterator<boost::multi_index::detail::random_access_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::null_augment_policy,
 boost::multi_index::detail::index_node_base<SwFrameFormat*, 
std::allocator<SwFrameFormat*> > > > > const&)
-SwFrameFormats::push_back(SwFrameFormat* const&)
-SwFrameFormats::~SwFrameFormats()
 SwGammaGrf::Clone(SfxItemPool*) const
 SwGammaGrf::GetPresentation(SfxItemPresentation, MapUnit, MapUnit, 
rtl::OUString&, IntlWrapper const&) const
 SwGammaGrf::PutValue(com::sun::star::uno::Any const&, unsigned char)
@@ -14368,7 +14353,6 @@ 
SwTextBoxHelper::isTextBoxShapeHasValidTextFrame(SwFrameFormat const*)
 SwTextBoxHelper::mapAnchorType(RndStdIds const&)
 SwTextBoxHelper::queryInterface(SwFrameFormat const*, 
com::sun::star::uno::Type const&)
 SwTextBoxHelper::restoreLinks(std::set<ZSortFly, std::less<ZSortFly>, 
std::allocator<ZSortFly> >&, std::vector<SwFrameFormat*, 
std::allocator<SwFrameFormat*> >&, std::map<SwFrameFormat const*, SwFrameFormat 
const*, std::less<SwFrameFormat const*>, std::allocator<std::pair<SwFrameFormat 
const* const, SwFrameFormat const*> > >&)
-SwTextBoxHelper::saveLinks(SwFrameFormats const&, std::map<SwFrameFormat 
const*, SwFrameFormat const*, std::less<SwFrameFormat const*>, 
std::allocator<std::pair<SwFrameFormat const* const, SwFrameFormat const*> > >&)
 SwTextBoxHelper::setWrapThrough(SwFrameFormat*)
 SwTextBoxHelper::syncFlyFrameAttr(SwFrameFormat&, SfxItemSet const&, 
SdrObject*)
 SwTextBoxHelper::syncProperty(SwFrameFormat*, std::basic_string_view<char16_t, 
std::char_traits<char16_t> >, com::sun::star::uno::Any const&, SdrObject*)
diff --git a/compilerplugins/clang/unusedmethods.results 
b/compilerplugins/clang/unusedmethods.results
index bdac66f71d72..6af7aa1e9480 100644
--- a/compilerplugins/clang/unusedmethods.results
+++ b/compilerplugins/clang/unusedmethods.results
@@ -2976,8 +2976,6 @@ sw/inc/dbgoutsw.hxx:72
     const char * dbg_out(const SwNumRule &)
 sw/inc/dbgoutsw.hxx:73
     const char * dbg_out(const SwTextFormatColl &)
-sw/inc/dbgoutsw.hxx:74
-    const char * dbg_out(const SwFrameFormats &)
 sw/inc/dbgoutsw.hxx:75
     const char * dbg_out(const SwNumRuleTable &)
 sw/inc/dbgoutsw.hxx:76
@@ -3012,10 +3010,6 @@ sw/inc/extinput.hxx:48
     const SwExtTextInput * SwExtTextInput::GetPrev() const
 sw/inc/formatcontentcontrol.hxx:82
     SwFormatContentControl * 
SwFormatContentControl::CreatePoolDefault(unsigned short)
-sw/inc/frameformats.hxx:80
-    void SwFrameFormats::erase(unsigned long)
-sw/inc/frameformats.hxx:97
-    SwFrameFormat *const & SwFrameFormats::back() const
 sw/inc/IDocumentLinksAdministration.hxx:54
     _Bool IDocumentLinksAdministration::GetData(const rtl::OUString &,const 
rtl::OUString &,com::sun::star::uno::Any &) const
 sw/inc/IDocumentLinksAdministration.hxx:56
diff --git a/sw/inc/dbgoutsw.hxx b/sw/inc/dbgoutsw.hxx
index 2d8af9972e21..97587d911333 100644
--- a/sw/inc/dbgoutsw.hxx
+++ b/sw/inc/dbgoutsw.hxx
@@ -41,7 +41,6 @@ class SwNodeNum;
 class SwUndo;
 class SwRect;
 class SwFrameFormat;
-class SwFrameFormats;
 class SwNumRuleTable;
 class SwNumRule;
 class SwOutlineNodes;
@@ -71,9 +70,9 @@ const char* dbg_out(const SwUndo& rUndo);
 const char* dbg_out(SwOutlineNodes const& rNodes);
 const char* dbg_out(const SwNumRule& rRule);
 const char* dbg_out(const SwTextFormatColl& rFormat);
-const char* dbg_out(const SwFrameFormats& rFrameFormats);
 const char* dbg_out(const SwNumRuleTable& rTable);
 const char* dbg_out(const SwNodeRange& rRange);
+const char* dbg_out(const sw::FrameFormats<sw::SpzFrameFormat*>& 
rFrameFormats);
 
 template <typename tKey, typename tMember, typename fHashFunction>
 OUString lcl_dbg_out(const std::unordered_map<tKey, tMember, fHashFunction>& 
rMap)
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index ef630faf1a33..c3ac513c4b52 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -246,7 +246,7 @@ class SW_DLLPUBLIC SwDoc final
     std::unique_ptr<SwTextFormatColl>  mpDfltTextFormatColl;  //< 
Defaultformatcollections
     std::unique_ptr<SwGrfFormatColl>   mpDfltGrfFormatColl;
 
-    std::unique_ptr<SwFrameFormats>    mpFrameFormatTable;    //< Format table
+    std::unique_ptr<sw::FrameFormats<SwFrameFormat*>>    mpFrameFormatTable;   
 //< Format table
     std::unique_ptr<SwCharFormats>     mpCharFormatTable;
     std::unique_ptr<sw::FrameFormats<sw::SpzFrameFormat*>>    
mpSpzFrameFormatTable;
     std::unique_ptr<SwSectionFormats>  mpSectionFormatTable;
@@ -748,8 +748,8 @@ public:
     bool DontExpandFormat( const SwPosition& rPos, bool bFlag = true );
 
     // Formats
-    const SwFrameFormats* GetFrameFormats() const     { return 
mpFrameFormatTable.get(); }
-          SwFrameFormats* GetFrameFormats()           { return 
mpFrameFormatTable.get(); }
+    const sw::FrameFormats<SwFrameFormat*>* GetFrameFormats() const     { 
return mpFrameFormatTable.get(); }
+          sw::FrameFormats<SwFrameFormat*>* GetFrameFormats()           { 
return mpFrameFormatTable.get(); }
     const SwCharFormats* GetCharFormats() const   { return 
mpCharFormatTable.get();}
           SwCharFormats* GetCharFormats()         { return 
mpCharFormatTable.get();}
 
diff --git a/sw/inc/frameformats.hxx b/sw/inc/frameformats.hxx
index be3e5fd9ae77..bdf0a69905b5 100644
--- a/sw/inc/frameformats.hxx
+++ b/sw/inc/frameformats.hxx
@@ -34,97 +34,6 @@ class SwTableFormat;
 
 // Like o3tl::find_partialorder_ptrequals
 // We don't allow duplicated object entries!
-struct type_name_key
-    : boost::multi_index::composite_key<
-          SwFrameFormat*,
-          boost::multi_index::const_mem_fun<SwFormat, const OUString&, 
&SwFormat::GetName>,
-          boost::multi_index::const_mem_fun<SwFormat, sal_uInt16, 
&SwFormat::Which>,
-          boost::multi_index::identity<SwFrameFormat*> // the actual object 
pointer
-          >
-{
-};
-
-typedef boost::multi_index_container<
-    SwFrameFormat*,
-    boost::multi_index::indexed_by<boost::multi_index::random_access<>,
-                                   
boost::multi_index::ordered_unique<type_name_key>>>
-    SwFrameFormatsBase;
-
-/// Specific frame formats (frames, DrawObjects).
-class SW_DLLPUBLIC SwFrameFormats final : public SwFormatsBase
-{
-    // function updating ByName index via modify
-    friend void SwFrameFormat::SetFormatName(const OUString&, bool);
-
-public:
-    typedef SwFrameFormatsBase::nth_index<0>::type ByPos;
-    typedef SwFrameFormatsBase::nth_index<1>::type ByTypeAndName;
-    typedef ByPos::iterator iterator;
-
-private:
-    SwFrameFormatsBase m_Array;
-    ByPos& m_PosIndex;
-    ByTypeAndName& m_TypeAndNameIndex;
-
-public:
-    typedef ByPos::const_iterator const_iterator;
-    typedef SwFrameFormatsBase::size_type size_type;
-    typedef SwFrameFormatsBase::value_type value_type;
-
-    SwFrameFormats();
-    // frees all SwFrameFormat!
-    virtual ~SwFrameFormats() override;
-
-    bool empty() const { return m_Array.empty(); }
-    size_t size() const { return m_Array.size(); }
-
-    // Only fails, if you try to insert the same object twice
-    std::pair<const_iterator, bool> push_back(const value_type& x);
-
-    // This will try to remove the exact object!
-    bool erase(const value_type& x);
-    void erase(size_type index);
-    void erase(const_iterator const& position);
-
-    // Get the iterator of the exact object (includes pointer!),
-    // e.g for position with std::distance.
-    // There is also ContainsFormat, if you don't need the position.
-    const_iterator find(const value_type& x) const;
-
-    ByTypeAndName::const_iterator findByTypeAndName(sal_uInt16 type, const 
OUString& name) const;
-    // search for formats by name
-    std::pair<ByTypeAndName::const_iterator, ByTypeAndName::const_iterator>
-    findRangeByName(const OUString& name) const;
-    // So we can actually check for end()
-    ByTypeAndName::const_iterator typeAndNameEnd() const { return 
m_TypeAndNameIndex.end(); }
-
-    const value_type& operator[](size_t index_) const { return 
m_PosIndex.operator[](index_); }
-    const value_type& front() const { return m_PosIndex.front(); }
-    const value_type& back() const { return m_PosIndex.back(); }
-    const_iterator begin() const { return m_PosIndex.begin(); }
-    const_iterator end() const { return m_PosIndex.end(); }
-
-    void dumpAsXml(xmlTextWriterPtr pWriter, const char* pName) const;
-
-    virtual size_t GetFormatCount() const override { return m_Array.size(); }
-    virtual SwFormat* GetFormat(size_t idx) const override { return 
operator[](idx); }
-    virtual void Rename(const SwFrameFormat& rFormat, const OUString& 
sNewName) override;
-
-    /// fast check if given format is contained here
-    /// @precond pFormat must not have been deleted
-    bool ContainsFormat(SwFrameFormat const& rFormat) const;
-    /// not so fast check that given format is still alive (i.e. contained 
here)
-    bool IsAlive(SwFrameFormat const*) const;
-
-    void DeleteAndDestroyAll(bool keepDefault = false);
-
-    bool newDefault(const value_type& x);
-    void newDefault(const_iterator const& position);
-
-    // Override return type to reduce casting
-    virtual SwFrameFormat* FindFormatByName(const OUString& rName) const 
override;
-};
-
 namespace sw
 {
 template <class value_type> class FrameFormats final : public SwFormatsBase
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 309aa78de552..c619da0e95a8 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -64,7 +64,6 @@ namespace sw
     class SpzFrameFormat;
 }
 class SwFormatsBase;
-class SwFrameFormats;
 class SwTableFormat;
 
 /// Style of a layout element.
@@ -74,9 +73,9 @@ class SW_DLLPUBLIC SwFrameFormat
     friend class SwDoc;
     friend class SwPageDesc;    ///< Is allowed to call protected CTor.
     friend class ::sw::DocumentLayoutManager; ///< Is allowed to call 
protected CTor.
-    friend class SwFrameFormats;     ///< Is allowed to update the list 
backref.
     friend class sw::FrameFormats<SwTableFormat*>;     ///< Is allowed to 
update the list backref.
     friend class sw::FrameFormats<sw::SpzFrameFormat*>;     ///< Is allowed to 
update the list backref.
+    friend class sw::FrameFormats<SwFrameFormat*>;     ///< Is allowed to 
update the list backref.
     friend class SwTextBoxHelper;
     friend class SwUndoFlyBase; ///< calls SetOtherTextBoxFormat
 
diff --git a/sw/inc/textboxhelper.hxx b/sw/inc/textboxhelper.hxx
index 2eef22d2b20e..c4f4c3d8fbbb 100644
--- a/sw/inc/textboxhelper.hxx
+++ b/sw/inc/textboxhelper.hxx
@@ -25,7 +25,6 @@ class SdrPage;
 class SdrObject;
 class SfxItemSet;
 class SwFrameFormat;
-class SwFrameFormats;
 class SwFormatAnchor;
 class SwFormatContent;
 class SwDoc;
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index 1c8e5327d4aa..a6edc6f0cc12 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -696,12 +696,12 @@ const char * dbg_out(const SwTextFormatColl & rFormat)
     return dbg_out(lcl_dbg_out(rFormat));
 }
 
-static OUString lcl_dbg_out(const SwFrameFormats & rFrameFormats)
+static OUString lcl_dbg_out(const sw::FrameFormats<sw::SpzFrameFormat*>& 
rFrameFormats)
 {
-    return lcl_dbg_out_SvPtrArr<SwFrameFormats>(rFrameFormats);
+    return 
lcl_dbg_out_SvPtrArr<sw::FrameFormats<sw::SpzFrameFormat*>>(rFrameFormats);
 }
 
-const char * dbg_out(const SwFrameFormats & rFrameFormats)
+const char * dbg_out(const sw::FrameFormats<sw::SpzFrameFormat*>& 
rFrameFormats)
 {
     return dbg_out(lcl_dbg_out(rFrameFormats));
 }
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 3994f2af8aac..c78d8e18b633 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -151,7 +151,7 @@ void SaveFlyInRange( const SwPaM& rPam, const SwPosition& 
rInsPos,
         atParaEnd.Adjust(SwNodeOffset(1));
     }
 
-    for( SwFrameFormats::size_type n = 0; n < rFormats.size(); ++n )
+    for(sw::FrameFormats<sw::SpzFrameFormat*>::size_type n = 0; n < 
rFormats.size(); ++n )
     {
         pFormat = rFormats[n];
         pAnchor = &pFormat->GetAnchor();
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index a0111f537469..bc5994a58d37 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -705,7 +705,7 @@ void SwDoc::DelFrameFormat( SwFrameFormat *pFormat, bool 
bBroadcast )
     else
     {
         // The format has to be in the one or the other, we'll see in which 
one.
-        if (mpFrameFormatTable->ContainsFormat(*pFormat))
+        if (mpFrameFormatTable->ContainsFormat(pFormat))
         {
             if (bBroadcast)
                 BroadcastStyleOperation(pFormat->GetName(),
@@ -745,7 +745,7 @@ void SwDoc::DelTableFrameFormat( SwTableFormat *pFormat )
 
 SwFrameFormat* SwDoc::FindFrameFormatByName( const OUString& rName ) const
 {
-    return mpFrameFormatTable->FindFormatByName( rName );
+    return 
static_cast<SwFrameFormat*>(mpFrameFormatTable->FindFormatByName(rName));
 }
 
 /// Create the formats
@@ -2064,126 +2064,4 @@ namespace docfunc
         return bRet;
     }
 }
-
-SwFrameFormats::SwFrameFormats()
-    : m_PosIndex( m_Array.get<0>() )
-    , m_TypeAndNameIndex( m_Array.get<1>() )
-{
-}
-
-SwFrameFormats::~SwFrameFormats()
-{
-    DeleteAndDestroyAll();
-}
-
-SwFrameFormats::const_iterator SwFrameFormats::find( const value_type& x ) 
const
-{
-    ByTypeAndName::iterator it = m_TypeAndNameIndex.find(
-        std::make_tuple(x->GetName(), x->Which(), x) );
-    return m_Array.project<0>( it );
-}
-
-SwFrameFormats::ByTypeAndName::const_iterator
-SwFrameFormats::findByTypeAndName( sal_uInt16 type, const OUString& name ) 
const
-{
-    return m_TypeAndNameIndex.find( std::make_tuple(name, type) );
-}
-
-std::pair<SwFrameFormats::ByTypeAndName::const_iterator, 
SwFrameFormats::ByTypeAndName::const_iterator>
-SwFrameFormats::findRangeByName( const OUString& rName ) const
-{
-    auto it = m_TypeAndNameIndex.lower_bound( std::make_tuple(rName, 
sal_uInt16(0)) );
-    auto itEnd = m_TypeAndNameIndex.upper_bound( std::make_tuple(rName, 
SAL_MAX_UINT16) );
-    return { it, itEnd };
-}
-
-SwFrameFormat* SwFrameFormats::FindFormatByName( const OUString& rName ) const
-{
-    auto it = m_TypeAndNameIndex.lower_bound( std::make_tuple(rName, 
sal_uInt16(0)) );
-    if (it != m_TypeAndNameIndex.end() && (*it)->GetName() == rName)
-        return *it;
-    return nullptr;
-}
-
-void SwFrameFormats::DeleteAndDestroyAll( bool keepDefault )
-{
-    if ( empty() )
-        return;
-    const int _offset = keepDefault ? 1 : 0;
-    for( const_iterator it = begin() + _offset; it != end(); ++it )
-        delete *it;
-    if ( _offset )
-        m_PosIndex.erase( begin() + _offset, end() );
-    else
-        m_Array.clear();
-}
-
-std::pair<SwFrameFormats::const_iterator,bool> SwFrameFormats::push_back( 
const value_type& x )
-{
-    SAL_WARN_IF(x->m_ffList != nullptr, "sw.core", "Inserting already assigned 
item");
-    assert(x->m_ffList == nullptr);
-    x->m_ffList = this;
-    return m_PosIndex.push_back( x );
-}
-
-bool SwFrameFormats::erase( const value_type& x )
-{
-    const_iterator const ret = find( x );
-    SAL_WARN_IF(x->m_ffList != this, "sw.core", "Removing invalid / unassigned 
item");
-    if (ret != end()) {
-        assert( x == *ret );
-        m_PosIndex.erase( ret );
-        x->m_ffList = nullptr;
-        return true;
-    }
-    return false;
-}
-
-void SwFrameFormats::erase( size_type index_ )
-{
-    erase( begin() + index_ );
-}
-
-void SwFrameFormats::erase( const_iterator const& position )
-{
-    (*position)->m_ffList = nullptr;
-    m_PosIndex.erase( begin() + (position - begin()) );
-}
-
-bool SwFrameFormats::ContainsFormat(const SwFrameFormat& x) const
-{
-    return (x.m_ffList == this);
-}
-
-bool SwFrameFormats::IsAlive(SwFrameFormat const*const p) const
-{
-    return find(const_cast<SwFrameFormat*>(p)) != end();
-}
-
-bool SwFrameFormats::newDefault( const value_type& x )
-{
-    std::pair<iterator,bool> res = m_PosIndex.push_front( x );
-    if( ! res.second )
-        newDefault( res.first );
-    return res.second;
-}
-
-void SwFrameFormats::newDefault( const_iterator const& position )
-{
-    if (position == begin())
-        return;
-    m_PosIndex.relocate( begin(), position );
-}
-
-void SwFrameFormats::Rename(const SwFrameFormat& rFormat, const OUString& 
rNewName)
-{
-    iterator it = find(const_cast<SwFrameFormat*>(&rFormat));
-    assert(end() != it);
-    const auto sOldName = rFormat.GetName();
-    auto fRenamer = [rNewName](SwFormat* pFormat) { 
pFormat->SwFormat::SetFormatName(rNewName, false); };
-    auto fRenamerUndo = [sOldName](SwFormat* pFormat) { 
pFormat->SwFormat::SetFormatName(sOldName, false); };
-    bool const renamed = m_PosIndex.modify(it, fRenamer, fRenamerUndo);
-    assert(renamed);
-    (void)renamed; // unused in NDEBUG
-}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 4cd8b7fa179c..737506ca275e 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -368,9 +368,10 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& 
rPath, bool bOutline,
                             CorrAbs( aSIdx, aEIdx, *aTmp.GetPoint(), true);
 
                             // If FlyFrames are still around, delete these too
-                            for( SwFrameFormats::size_type n = 0; n < 
GetSpzFrameFormats()->size(); ++n )
+                            auto& rSpzs = *GetSpzFrameFormats();
+                            
for(sw::FrameFormats<sw::SpzFrameFormat*>::size_type n = 0; n < 
GetSpzFrameFormats()->size(); ++n)
                             {
-                                SwFrameFormat* pFly = 
(*GetSpzFrameFormats())[n];
+                                auto pFly = rSpzs[n];
                                 const SwFormatAnchor* pAnchor = 
&pFly->GetAnchor();
                                 SwNode const*const pAnchorNode =
                                     pAnchor->GetAnchorNode();
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 0ab802a5b6cd..02029856a09e 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1369,7 +1369,7 @@ static OUString lcl_GetUniqueFlyName(const SwDoc& rDoc, 
TranslateId pDefStrId, s
     }
 
     // All numbers are flagged accordingly, so determine the right one
-    SwFrameFormats::size_type nNum = first_available_number(aUsedNums) + 1;
+    auto nNum = first_available_number(aUsedNums) + 1;
     return aName + OUString::number(nNum);
 }
 
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index bfc8c71dfe48..d6e885e8219a 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -232,7 +232,7 @@ SwDoc::SwDoc()
     mpDfltCharFormat( new SwCharFormat( GetAttrPool(), 
DEFAULT_CHAR_FORMAT_NAME, nullptr ) ),
     mpDfltTextFormatColl( new SwTextFormatColl( GetAttrPool(), "Paragraph 
style" ) ),
     mpDfltGrfFormatColl( new SwGrfFormatColl( GetAttrPool(), 
"Graphikformatvorlage" ) ),
-    mpFrameFormatTable( new SwFrameFormats() ),
+    mpFrameFormatTable( new sw::FrameFormats<SwFrameFormat*>() ),
     mpCharFormatTable( new SwCharFormats ),
     mpSpzFrameFormatTable( new sw::FrameFormats<sw::SpzFrameFormat*>() ),
     mpSectionFormatTable( new SwSectionFormats ),
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 3c8966f3147b..7e9d2d3013c5 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -45,7 +45,6 @@ class SwNodeIndex;
 class GraphicObject;
 class GraphicAttr;
 class SwPageDesc;
-class SwFrameFormats;
 class SwRegionRects;
 class SwTextNode;
 namespace sw { struct Extent; }
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index b81a2fab65a9..f6934822b74f 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2922,15 +2922,6 @@ void SwFrameFormat::dumpAsXml(xmlTextWriterPtr pWriter) 
const
     (void)xmlTextWriterEndElement(pWriter);
 }
 
-void SwFrameFormats::dumpAsXml(xmlTextWriterPtr pWriter, const char* pName) 
const
-{
-    (void)xmlTextWriterStartElement(pWriter, BAD_CAST(pName));
-    for (const SwFrameFormat *pFormat : m_PosIndex)
-        pFormat->dumpAsXml(pWriter);
-    (void)xmlTextWriterEndElement(pWriter);
-}
-
-
 SwFlyFrameFormat::SwFlyFrameFormat(SwAttrPool& rPool, const OUString 
&rFormatName, SwFrameFormat* pDerivedFrame)
     : sw::SpzFrameFormat(rPool, rFormatName, pDerivedFrame, RES_FLYFRMFMT)
 {}
diff --git a/sw/source/filter/basflt/shellio.cxx 
b/sw/source/filter/basflt/shellio.cxx
index c4bdc52c7590..2f5145024156 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -245,7 +245,7 @@ ErrCode SwReader::Read( const Reader& rOptions )
                                    rNd.FindFooterStartNode();
 
             // search all new Fly's, and store them as individual Undo Objects
-            for( SwFrameFormats::size_type n = 0; n < 
mxDoc->GetSpzFrameFormats()->size(); ++n )
+            for( sw::FrameFormats<sw::SpzFrameFormat*>::size_type n = 0; n < 
mxDoc->GetSpzFrameFormats()->size(); ++n )
             {
                 SwFrameFormat* pFrameFormat = (*mxDoc->GetSpzFrameFormats())[ 
n ];
                 const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor();
diff --git a/sw/source/uibase/app/docstyle.cxx 
b/sw/source/uibase/app/docstyle.cxx
index 6e0ffc5d1cdd..b7d1eb9e0682 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -1757,8 +1757,7 @@ static void lcl_SaveStyles( SfxStyleFamily nFamily, 
std::vector<void*>& rArr, Sw
         break;
     case SfxStyleFamily::Frame:
         {
-            const SwFrameFormats& rTable = *rDoc.GetFrameFormats();
-            for(auto const& rFrame: rTable)
+            for(auto const& rFrame: *rDoc.GetFrameFormats())
             {
                 rArr.push_back(rFrame);
             }
@@ -1828,8 +1827,7 @@ static void lcl_DeleteInfoStyles( SfxStyleFamily nFamily, 
std::vector<void*> con
     case SfxStyleFamily::Frame:
         {
             std::deque<SwFrameFormat*> aDelArr;
-            const SwFrameFormats& rTable = *rDoc.GetFrameFormats();
-            for( auto const& rFrame: rTable )
+            for(auto const& rFrame: *rDoc.GetFrameFormats())
             {
                 if( !lcl_Contains( rArr, rFrame ))
                     aDelArr.push_front( rFrame );

Reply via email to