summaryrefslogtreecommitdiff
path: root/include/formula
diff options
context:
space:
mode:
authorJeffrey Stedfast <jeff@xamarin.com>2014-07-26 21:25:38 -0400
committerKohei Yoshida <libreoffice@kohei.us>2014-07-27 04:03:07 +0000
commitce4e7a830d5350848d3c83b872f916a7b1691266 (patch)
tree519df48247d08c505b5a9ecf7d87e3ed9bd380cb /include/formula
parent70599252873c3dbe03e36083ad093aedfdb8b923 (diff)
fdo#81038 Fixed FormulaTokenIterator to use std::vector instead of linked list
Change-Id: I09f9adfa52b64732cc6200a0dbeb6263435c7c07 Reviewed-on: https://gerrit.libreoffice.org/10565 Reviewed-by: Kohei Yoshida <libreoffice@kohei.us> Tested-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'include/formula')
-rw-r--r--include/formula/tokenarray.hxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index dcc8dc9200ef..e20d5781b26a 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -257,19 +257,19 @@ inline OpCode FormulaTokenArray::GetOuterFuncOpCode()
return ocNone;
}
-struct ImpTokenIterator
+class FORMULA_DLLPUBLIC FormulaTokenIterator
{
- ImpTokenIterator* pNext;
- const FormulaTokenArray* pArr;
- short nPC;
- short nStop;
+ struct Item
+ {
+ public:
+ const FormulaTokenArray* pArr;
+ short nPC;
+ short nStop;
- DECL_FIXEDMEMPOOL_NEWDEL( ImpTokenIterator );
-};
+ Item(const FormulaTokenArray* arr, short pc, short stop);
+ };
-class FORMULA_DLLPUBLIC FormulaTokenIterator
-{
- ImpTokenIterator* pCur;
+ std::vector<Item> *maStack;
public:
FormulaTokenIterator( const FormulaTokenArray& );
@@ -278,8 +278,8 @@ public:
const FormulaToken* Next();
const FormulaToken* PeekNextOperator();
bool IsEndOfPath() const; /// if a jump or subroutine path is done
- bool HasStacked() const { return pCur->pNext != 0; }
- short GetPC() const { return pCur->nPC; }
+ bool HasStacked() const { return maStack->size() > 1; }
+ short GetPC() const { return maStack->back().nPC; }
/** Jump or subroutine call.
Program counter values will be incremented before code is executed =>