diff options
author | Eike Rathke <erack@redhat.com> | 2015-06-15 14:51:52 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-06-15 17:52:16 +0200 |
commit | 1d463600f4db2993838c7660da2cb87aa19218fd (patch) | |
tree | 9679701e0ab6da444e912abf48f02e59c8cafbd8 /include/formula | |
parent | 09c5a9d41e03b3137ce47b9f9419290525458337 (diff) |
prepare ReplaceToken() to replace also in RPN
Change-Id: I98fbcb9849f2c2b1f26109a54ecbf5347cdd8b4e
Diffstat (limited to 'include/formula')
-rw-r--r-- | include/formula/tokenarray.hxx | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index 8aebb4b1b45f..d06d3e1a0f25 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -122,10 +122,29 @@ protected: /// Also used by the compiler. The token MUST had been allocated with new! FormulaToken* Add( FormulaToken* ); + + enum ReplaceMode + { + BACKWARD_CODE_ONLY, ///< offset goes backward, replacement only in pCode + FORWARD_CODE_AND_RPN ///< offset goes forward, replacement in pCode and RPN + }; + /** Also used by the compiler. The token MUST had been allocated with new! - @param nOffset negative offset of token, 0==last, 1==previous, ... + @param nOffset + If eMode==BACKWARD_CODE_ONLY negative offset of token, 0==last, + 1==previous, ... + If eMode==FORWARD_CODE_AND_RPN positive offset of token, 0==first, + 1==second, ... + @param eMode + If BACKWARD_CODE_ONLY only the token in pCode at nLen-nOffset-1 + is replaced. + If FORWARD_CODE_AND_RPN the token in pCode at nOffset is + replaced; if the original token was also referenced in the RPN + array then that reference is replaced with a reference to the new + token as well. */ - FormulaToken* ReplaceToken( sal_uInt16 nOffset, FormulaToken* ); + FormulaToken* ReplaceToken( sal_uInt16 nOffset, FormulaToken*, ReplaceMode eMode ); + inline void SetCombinedBitsRecalcMode( ScRecalcMode nBits ) { nMode |= (nBits & ~RECALCMODE_EMASK); } inline ScRecalcMode GetCombinedBitsRecalcMode() const |