diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-08-11 23:10:37 +0900 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-08-12 02:58:54 -0500 |
commit | 4347d844646907ba31dc1e0c7f53c5a93d986c2a (patch) | |
tree | 75d3aac6dc29ff38b20d88c8be8b43fa71e0dadb /sd | |
parent | 9851925959c564e37235da29b3bd347ff1dc3d01 (diff) |
fdo#75757: remove inheritance to std::vector
Change-Id: I5781799bbd8cc321ff7f659013c6cf68b3253989
Reviewed-on: https://gerrit.libreoffice.org/10868
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/inc/customshowlist.hxx | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/sd/inc/customshowlist.hxx b/sd/inc/customshowlist.hxx index 466c43633e9f..0fdd8c041cb8 100644 --- a/sd/inc/customshowlist.hxx +++ b/sd/inc/customshowlist.hxx @@ -24,54 +24,59 @@ class SdCustomShow; -class SdCustomShowList : private std::vector<SdCustomShow*> +class SdCustomShowList { private: + std::vector<SdCustomShow*> mShows; sal_uInt16 mnCurPos; public: - using std::vector<SdCustomShow*>::operator[]; - using std::vector<SdCustomShow*>::size; - using std::vector<SdCustomShow*>::empty; - using std::vector<SdCustomShow*>::push_back; - using std::vector<SdCustomShow*>::erase; - using std::vector<SdCustomShow*>::begin; - using std::vector<SdCustomShow*>::iterator; - SdCustomShowList() - : mnCurPos(0) + : mShows(), mnCurPos(0) { } + bool empty() const {return mShows.empty();} + + size_t size() const {return mShows.size();} + + SdCustomShow* &operator[](size_t i) {return mShows[i];} + + std::vector<SdCustomShow*>::iterator begin() {return mShows.begin();} + + void erase(std::vector<SdCustomShow*>::iterator it) {mShows.erase(it);} + + void push_back(SdCustomShow* p) {mShows.push_back(p);} + sal_uInt16 GetCurPos() const { return mnCurPos; } void Seek(sal_uInt16 nNewPos) { mnCurPos = nNewPos; } SdCustomShow* First() { - if( empty() ) + if( mShows.empty() ) return NULL; mnCurPos = 0; - return operator[](mnCurPos); + return mShows[mnCurPos]; } SdCustomShow* Next() { ++mnCurPos; - return mnCurPos >= size() ? NULL : operator[](mnCurPos); + return mnCurPos >= mShows.size() ? NULL : mShows[mnCurPos]; } void Last() { - if( !empty() ) - mnCurPos = size() - 1; + if( !mShows.empty() ) + mnCurPos = mShows.size() - 1; } SdCustomShow* GetCurObject() { - return empty() ? NULL : operator[](mnCurPos); + return mShows.empty() ? NULL : mShows[mnCurPos]; } SdCustomShow* Remove(SdCustomShow* p) { - iterator it = std::find(begin(), end(), p); - if( it == end() ) + std::vector<SdCustomShow*>::iterator it = std::find(mShows.begin(), mShows.end(), p); + if( it == mShows.end() ) return NULL; - erase(it); + mShows.erase(it); return p; } }; |