diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2016-10-20 17:35:07 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2016-10-20 14:22:05 +0000 |
commit | 5e4a2abde982416c5dcaf5f481582115463a4219 (patch) | |
tree | 33297da4c825804909bf79ec96fe4030a3de9415 | |
parent | 373f3313a565b991d6cdc8bef1d48491e41254a4 (diff) |
sw: Avoid inheritance from std::vector
Change-Id: I4ee09871ec0fa5c67a8d4c4c448229ec2deda4c2
Reviewed-on: https://gerrit.libreoffice.org/30075
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
-rw-r--r-- | sw/inc/swtable.hxx | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index 96d212e68f5d..c1e9a50fe82e 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -62,11 +62,40 @@ class SwServerObject; void sw_GetTableBoxColStr( sal_uInt16 nCol, OUString& rNm ); -class SwTableLines : public std::vector<SwTableLine*> { +class SwTableLines +{ + std::vector<SwTableLine*> m_vLines; + public: + typedef std::vector<SwTableLine*>::size_type size_type; + typedef std::vector<SwTableLine*>::iterator iterator; + typedef std::vector<SwTableLine*>::const_iterator const_iterator; + // free's any remaining child objects ~SwTableLines(); + bool empty() const { return m_vLines.empty(); } + size_type size() const { return m_vLines.size(); } + iterator begin() { return m_vLines.begin(); } + const_iterator begin() const { return m_vLines.begin(); } + iterator end() { return m_vLines.end(); } + const_iterator end() const { return m_vLines.end(); } + SwTableLine* front() const { return m_vLines.front(); } + SwTableLine* back() const { return m_vLines.back(); } + void clear() { m_vLines.clear(); } + iterator erase( iterator aIt ) { return m_vLines.erase( aIt ); } + iterator erase( iterator aFirst, iterator aLast ) { return m_vLines.erase( aFirst, aLast ); } + iterator insert( iterator aIt, SwTableLine* pLine ) { return m_vLines.insert( aIt, pLine ); } + template<typename TInputIterator> + void insert( iterator aIt, TInputIterator aFirst, TInputIterator aLast ) + { + m_vLines.insert( aIt, aFirst, aLast ); + } + void push_back( SwTableLine* pLine ) { m_vLines.push_back( pLine ); } + void reserve( size_type nSize ) { m_vLines.reserve( nSize ); } + SwTableLine*& operator[]( size_type nPos ) { return m_vLines[ nPos ]; } + SwTableLine* operator[]( size_type nPos ) const { return m_vLines[ nPos ]; } + // return USHRT_MAX if not found, else index of position sal_uInt16 GetPos(const SwTableLine* pBox) const { |