diff options
author | Tor Lillqvist <tml@collabora.com> | 2017-06-13 17:09:24 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2017-06-13 17:27:02 +0300 |
commit | 7b67e3fc5566f4172c69fa8460aea0c006e97a4d (patch) | |
tree | 7dd69ed70bdfe9b24ff9df589ccecbbfad93f072 /formula | |
parent | c573a10a6a873af11c25fef59a374a37fe76056f (diff) |
Add FirstToken() and FirstRPNToken() functions that don't touch nIndex
... to FormulaTokenArray. Intermediate commit, these new functions
aren't used yet.
Change-Id: Ie505fe9dbd787087fa29f701d29ff9b4495c8699
Diffstat (limited to 'formula')
-rw-r--r-- | formula/source/core/api/token.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index 978dc2e198b6..a451e2a6c107 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -600,6 +600,13 @@ void FormulaTokenArray::DelRPN() nRPN = nIndex = 0; } +FormulaToken* FormulaTokenArray::FirstToken() const +{ + if (!pCode || nLen == 0) + return nullptr; + return pCode[0]; +} + FormulaToken* FormulaTokenArray::PeekPrev( sal_uInt16 & nIdx ) { if (0 < nIdx && nIdx <= nLen) @@ -647,6 +654,13 @@ FormulaToken* FormulaTokenArray::PeekPrevNoSpaces() return nullptr; } +FormulaToken* FormulaTokenArray::FirstRPNToken() const +{ + if (!pRPN || nRPN == 0) + return nullptr; + return pRPN[0]; +} + bool FormulaTokenArray::HasReferences() const { for (sal_uInt16 i = 0; i < nLen; ++i) |