diff options
-rw-r--r-- | formula/source/core/api/token.cxx | 4 | ||||
-rw-r--r-- | include/formula/tokenarray.hxx | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index 0eb906642636..072216b955cb 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -856,7 +856,7 @@ FormulaToken* FormulaTokenArray::ReplaceToken( sal_uInt16 nOffset, FormulaToken* } } -void FormulaTokenArray::RemoveToken( sal_uInt16 nOffset, sal_uInt16 nCount ) +sal_uInt16 FormulaTokenArray::RemoveToken( sal_uInt16 nOffset, sal_uInt16 nCount ) { if (nOffset < nLen) { @@ -903,10 +903,12 @@ void FormulaTokenArray::RemoveToken( sal_uInt16 nOffset, sal_uInt16 nCount ) else nIndex -= nStop - nOffset; } + return nCount; } else { SAL_WARN("formula.core","FormulaTokenArray::RemoveToken - nOffset " << nOffset << " >= nLen " << nLen); + return 0; } } diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index e7f32316eae2..b1d2deb3318d 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -166,8 +166,10 @@ protected: Start offset into pCode. @param nCount Count of tokens to remove. + + @return Count of tokens removed. */ - void RemoveToken( sal_uInt16 nOffset, sal_uInt16 nCount ); + sal_uInt16 RemoveToken( sal_uInt16 nOffset, sal_uInt16 nCount ); inline void SetCombinedBitsRecalcMode( ScRecalcMode nBits ) { nMode |= (nBits & ~RECALCMODE_EMASK); } |