Kaydet (Commit) c9be1193 authored tarafından Takeshi Abe's avatar Takeshi Abe Kaydeden (comit) David Tardon

fdo#75757: remove inheritance to std::vector

Change-Id: Ia2f03e08199f23fd1b226db2c7e0bfade07bf0f0
Reviewed-on: https://gerrit.libreoffice.org/10719Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst 8c0bd0de
...@@ -52,11 +52,14 @@ ...@@ -52,11 +52,14 @@
using namespace sfx2; using namespace sfx2;
using namespace ::com::sun::star; using namespace ::com::sun::star;
class SvBaseLinkMemberList : private std::vector<SvBaseLink*> { class SvBaseLinkMemberList {
private:
std::vector<SvBaseLink*> mLinks;
public: public:
~SvBaseLinkMemberList() ~SvBaseLinkMemberList()
{ {
for( const_iterator it = begin(); it != end(); ++it ) for( std::vector<SvBaseLink*>::const_iterator it = mLinks.begin(); it != mLinks.end(); ++it )
{ {
SvBaseLink* p = *it; SvBaseLink* p = *it;
if( p ) if( p )
...@@ -64,10 +67,15 @@ public: ...@@ -64,10 +67,15 @@ public:
} }
} }
using std::vector<SvBaseLink*>::size; size_t size() const { return mLinks.size(); }
using std::vector<SvBaseLink*>::operator[];
SvBaseLink *operator[](size_t i) const { return mLinks[i]; }
void push_back(SvBaseLink* p) { std::vector<SvBaseLink*>::push_back(p); p->AddRef(); } void push_back(SvBaseLink* p)
{
mLinks.push_back(p);
p->AddRef();
}
}; };
// attention, this array is indexed directly (0, 1, ...) in the code // attention, this array is indexed directly (0, 1, ...) in the code
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment