diff options
author | Joseph Powers <jpowers27@cox.net> | 2011-09-05 19:29:12 -0700 |
---|---|---|
committer | Joseph Powers <jpowers27@cox.net> | 2011-09-05 19:30:31 -0700 |
commit | 69bf43444e0cdf00ff909feb8138188b28394139 (patch) | |
tree | cc2949b7f9232a8a81124481a32b97172f89a254 /tools | |
parent | d3d1481fe835db3dcc0a43c0ad89043e6d71b4f0 (diff) |
Make macro PRV_SV_DECL_REF_LIST() no longer reference the DECLARE_LIST macro
Yes, I just expanded the DECLARE_LIST macro inside the other macro; however,
this is one of two macros that include DECLARE_LIST. Thus, I'll be able to
remove DECLARE_LIST shortly.
I still need to roll the code a little better. We shouldn't have a CN##List
class. It should be posiable to make the CN##MemberList class be based on
List diectly. Once that's done, it shouldn't be too hard to replace List
with either std::vector<> or std::list<>.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inc/tools/ref.hxx | 97 |
1 files changed, 77 insertions, 20 deletions
diff --git a/tools/inc/tools/ref.hxx b/tools/inc/tools/ref.hxx index 6629a4f162a6..c3e2d19d4766 100644 --- a/tools/inc/tools/ref.hxx +++ b/tools/inc/tools/ref.hxx @@ -112,31 +112,88 @@ PRV_SV_IMPL_REF_COUNTERS( ClassName, Lock, OwnerLock( sal_True ), \ /************************** S v R e f L i s t ****************************/ #define PRV_SV_DECL_REF_LIST(CN,EN,vis) \ -DECLARE_LIST(CN##List,EN)\ +class CN##List : private List \ +{ \ +public: \ + using List::Clear; \ + using List::Count; \ + using List::GetCurPos; \ + \ + CN##List( sal_uInt16 _nInitSize = 16, sal_uInt16 _nReSize = 16 ) \ + : List( _nInitSize, _nReSize ) {} \ + CN##List( sal_uInt16 _nBlockSize, sal_uInt16 _nInitSize, \ + sal_uInt16 _nReSize ) \ + : List( _nBlockSize, _nInitSize, _nReSize ) {} \ + CN##List( const CN##List& rClassName ) \ + : List( rClassName ) {} \ + \ + void Insert( EN p, sal_uIntPtr nIndex ) \ + { List::Insert( (void*)p, nIndex ); } \ + void Insert( EN p ) \ + { List::Insert( (void*)p ); } \ + EN Remove() \ + { return (EN)List::Remove(); } \ + EN Remove( sal_uIntPtr nIndex ) \ + { return (EN)List::Remove( nIndex ); } \ + EN Remove( EN p ) \ + { return (EN)List::Remove( (void*)p ); } \ + EN Replace( EN p, sal_uIntPtr nIndex ) \ + { return (EN)List::Replace( (void*)p, nIndex ); } \ + EN Replace( EN pNew, EN pOld ) \ + { return (EN)List::Replace( (void*)pNew, (void*)pOld ); } \ + \ + EN GetCurObject() const \ + { return (EN)List::GetCurObject(); } \ + EN GetObject( sal_uIntPtr nIndex ) const \ + { return (EN)List::GetObject( nIndex ); } \ + sal_uIntPtr GetPos( const EN p ) const \ + { return List::GetPos( (const void*)p ); } \ + \ + EN Seek( sal_uIntPtr nIndex ) \ + { return (EN)List::Seek( nIndex ); } \ + EN Seek( void* p ) { return (EN)List::Seek( p ); } \ + EN First() { return (EN)List::First(); } \ + EN Last() { return (EN)List::Last(); } \ + EN Next() { return (EN)List::Next(); } \ + EN Prev() { return (EN)List::Prev(); } \ + \ + CN##List& operator =( const CN##List& rClassName ) \ + { List::operator =( rClassName ); return *this; } \ + \ + sal_Bool operator ==( const CN##List& rList ) const \ + { return List::operator ==( rList ); } \ + sal_Bool operator !=( const CN##List& rList ) const \ + { return List::operator !=( rList ); } \ +}; \ class vis CN##MemberList : public CN##List\ {\ public:\ -inline CN##MemberList();\ -inline CN##MemberList(sal_uInt16 nInitSz, sal_uInt16 nResize );\ -inline CN##MemberList( const CN##MemberList & rRef );\ -inline ~CN##MemberList();\ -inline CN##MemberList & operator =\ - ( const CN##MemberList & rRef );\ -inline void Clear();\ -inline void Insert( EN p )\ -{ CN##List::Insert( p ); p->AddRef();}\ -inline void Insert( EN p, sal_uIntPtr nIndex )\ -{ CN##List::Insert( p, nIndex ); p->AddRef();}\ -inline void Append( EN p )\ -{ Insert( p, LIST_APPEND );}\ -inline EN Remove();\ -inline EN Remove( sal_uIntPtr nIndex );\ -inline EN Remove( EN p );\ -inline EN Replace( EN p, sal_uIntPtr nIndex );\ -inline EN Replace( EN pNew, EN pOld );\ -inline void Append( const CN##MemberList & );\ + inline CN##MemberList();\ + inline CN##MemberList(sal_uInt16 nInitSz, sal_uInt16 nResize );\ + inline CN##MemberList( const CN##MemberList & rRef );\ + inline ~CN##MemberList();\ + inline CN##MemberList & operator =( const CN##MemberList & rRef );\ + inline void Clear();\ + inline void Insert( EN p )\ + {\ + CN##List::Insert( p );\ + p->AddRef();\ + }\ + inline void Insert( EN p, sal_uIntPtr nIndex )\ + {\ + CN##List::Insert( p, nIndex );\ + p->AddRef();\ + }\ + inline void Append( EN p ) { Insert( p, LIST_APPEND ); }\ + inline EN Remove();\ + inline EN Remove( sal_uIntPtr nIndex );\ + inline EN Remove( EN p );\ + inline EN Replace( EN p, sal_uIntPtr nIndex );\ + inline EN Replace( EN pNew, EN pOld );\ + inline void Append( const CN##MemberList & );\ }; + #define SV_DECL_REF_LIST(CN,EN) \ PRV_SV_DECL_REF_LIST(CN,EN,/* empty */) |