summaryrefslogtreecommitdiff
path: root/sw/inc/docary.hxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2015-06-20 20:23:44 +0000
committerJan-Marek Glogowski <glogow@fbihome.de>2016-08-29 13:13:14 +0200
commitefb68beb538b97148c3dbf54ce46c3a8bc49cd92 (patch)
tree3d0e0d46e58b6884bdd943b80b6783b13e5ba8a2 /sw/inc/docary.hxx
parentd460ec312a5510955828be1ff35f92faef89e755 (diff)
Don't inheritate from boost::multi_index
Drops all using statements and the namespace aliases. This is more in the spirit of tdf#75757. Change-Id: Id7c81baea0e2d1af151b7b9bdce8d9fe5f7a2089
Diffstat (limited to 'sw/inc/docary.hxx')
-rw-r--r--sw/inc/docary.hxx49
1 files changed, 25 insertions, 24 deletions
diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index e4a0b263bfcf..93def1f8bc65 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -148,37 +148,37 @@ public:
SwGrfFormatColls() : SwFormatsModifyBase( DestructorPolicy::KeepElements ) {}
};
-namespace bmi = boost::multi_index;
-
// Like o3tl::find_partialorder_ptrequals
// We don't allow duplicated object entries!
-struct type_name_key:bmi::composite_key<
+struct type_name_key:boost::multi_index::composite_key<
SwFrameFormat*,
- bmi::const_mem_fun<SwFormat,sal_uInt16,&SwFormat::Which>,
- bmi::const_mem_fun<SwFormat,const OUString&,&SwFormat::GetName>,
- bmi::identity<SwFrameFormat*> // the actual object pointer
+ boost::multi_index::const_mem_fun<SwFormat,sal_uInt16,&SwFormat::Which>,
+ boost::multi_index::const_mem_fun<SwFormat,const OUString&,&SwFormat::GetName>,
+ boost::multi_index::identity<SwFrameFormat*> // the actual object pointer
>{};
typedef boost::multi_index_container<
SwFrameFormat*,
- bmi::indexed_by<
- bmi::random_access<>,
- bmi::ordered_unique< type_name_key >
+ 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 : public SwFrameFormatsBase, public SwFormatsBase
+class SW_DLLPUBLIC SwFrameFormats : public SwFormatsBase
{
// function updating ByName index via modify
friend void SwFrameFormat::SetName( const OUString&, bool );
- typedef nth_index<0>::type ByPos;
- typedef nth_index<1>::type ByTypeAndName;
+ typedef SwFrameFormatsBase::nth_index<0>::type ByPos;
+ typedef SwFrameFormatsBase::nth_index<1>::type ByTypeAndName;
typedef ByPos::iterator iterator;
- using ByPos::modify;
+ SwFrameFormatsBase m_Array;
+ ByPos &m_PosIndex;
+ ByTypeAndName &m_TypeAndNameIndex;
public:
typedef ByPos::const_iterator const_iterator;
@@ -186,12 +186,13 @@ public:
typedef SwFrameFormatsBase::size_type size_type;
typedef SwFrameFormatsBase::value_type value_type;
+ SwFrameFormats();
// frees all SwFrameFormat!
virtual ~SwFrameFormats();
- using SwFrameFormatsBase::clear;
- using SwFrameFormatsBase::empty;
- using SwFrameFormatsBase::size;
+ void clear() { return m_Array.clear(); }
+ 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 );
@@ -215,20 +216,20 @@ public:
std::pair<const_range_iterator,const_range_iterator>
rangeFind( const value_type& x ) const;
// So we can actually check for end()
- const_range_iterator rangeEnd() const { return ByTypeAndName::end(); }
+ const_range_iterator rangeEnd() const { return m_TypeAndNameIndex.end(); }
inline const_iterator rangeProject( const_range_iterator const& position )
- { return project<0>( position ); }
+ { return m_Array.project<0>( position ); }
const value_type& operator[]( size_t index_ ) const
- { return ByPos::operator[]( index_ ); }
- const value_type& front() const { return ByPos::front(); }
- const value_type& back() const { return ByPos::back(); }
- const_iterator begin() const { return ByPos::begin(); }
- const_iterator end() const { return ByPos::end(); }
+ { 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(struct _xmlTextWriter* pWriter, const char* pName) const;
- virtual size_t GetFormatCount() const { return size(); }
+ virtual size_t GetFormatCount() const { return m_Array.size(); }
virtual SwFormat* GetFormat(size_t idx) const { return operator[]( idx ); }
bool Contains( const value_type& x ) const;