summaryrefslogtreecommitdiff
path: root/sc/source/filter/inc
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-09-04 14:30:28 +0900
committerCaolán McNamara <caolanm@redhat.com>2014-09-05 10:37:27 -0500
commita2762333bc052212b44200adfe553e46b83e53d2 (patch)
tree8e37e5003021ebe21708680debbcb754357de6ac /sc/source/filter/inc
parent247f87bc08e2f71e44d8f7f9af791e9288714985 (diff)
fdo#75757: remove inheritance to std::vector
from ApiTokenVector. Change-Id: Ie924e0e01db74b925a7f6063f8ce7fd952d04381 Reviewed-on: https://gerrit.libreoffice.org/11290 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/filter/inc')
-rw-r--r--sc/source/filter/inc/formulabase.hxx25
1 files changed, 24 insertions, 1 deletions
diff --git a/sc/source/filter/inc/formulabase.hxx b/sc/source/filter/inc/formulabase.hxx
index 8c2765f0f2e5..83b7bb47ccb6 100644
--- a/sc/source/filter/inc/formulabase.hxx
+++ b/sc/source/filter/inc/formulabase.hxx
@@ -263,11 +263,28 @@ typedef ::com::sun::star::uno::Sequence< ApiToken > ApiTokenSequence;
typedef ::com::sun::star::beans::Pair< ::com::sun::star::table::CellAddress, sal_Bool > ApiSpecialTokenInfo;
/** A vector of formula tokens with additional convenience functions. */
-class ApiTokenVector : public ::std::vector< ApiToken >
+class ApiTokenVector
{
public:
explicit ApiTokenVector();
+ ApiToken& operator[]( size_t i ) { return mvTokens[i]; }
+
+ size_t size() const { return mvTokens.size(); }
+
+ ApiToken& back() { return mvTokens.back(); }
+ const ApiToken& back() const { return mvTokens.back(); }
+
+ void clear() { mvTokens.clear(); }
+
+ void pop_back() { mvTokens.pop_back(); }
+
+ void push_back( const ApiToken& rToken ) { mvTokens.push_back( rToken ); }
+
+ void reserve( size_t n ) { mvTokens.reserve( n ); }
+
+ void resize( size_t n ) { mvTokens.resize( n ); }
+
/** Appends a new token with the passed op-code, returns its data field. */
::com::sun::star::uno::Any&
append( sal_Int32 nOpCode );
@@ -275,6 +292,12 @@ public:
/** Appends a new token with the passed op-code and data. */
template< typename Type >
inline void append( sal_Int32 nOpCode, const Type& rData ) { append( nOpCode ) <<= rData; }
+
+ /** Converts to a sequence. */
+ ApiTokenSequence toSequence() const;
+
+private:
+ ::std::vector< ApiToken > mvTokens;
};
// Token sequence iterator ====================================================