summaryrefslogtreecommitdiff
path: root/include/formula
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-01-05 11:54:32 +0100
committerEike Rathke <erack@redhat.com>2016-01-05 12:10:02 +0100
commit2f79244cb3fcc4cbfd2b818380ea9d62b49aaade (patch)
tree306fe6d90280bb387fddfa3d30644c065e45c58f /include/formula
parent72ac13eb648fdc87d78d458a81b79c5b7ce0d82e (diff)
tdf#96198 detect old ISO/WEEKNUM usage with two arguments, tdf#50950 follow-up
5.0 and earlier implemented WEEKNUM(date,mode) with mode!=1 such that effectively an ISO 8601 week number was calculated. WEEKNUM was wrongly saved as ISOWEEKNUM (even with two parameters though it is defined to have only one) so that when reading it we can try to detect a literal double argument for mode and if it is not 1 remove it to keep ISOWEEKNUM(date) instead of calling WEEKNUM(date,mode) which wouldn't match. A further change to 5.0 to accept also only one parameter in WEEKNUM(date) and for this default the mode to not 1 for ISO week will yield forward compatibility. Change-Id: I88de7dd809d69b6826a190505d2a1dd3fe79c90b
Diffstat (limited to 'include/formula')
-rw-r--r--include/formula/tokenarray.hxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index 6dcbcfc442d6..292b3182cb8b 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -148,6 +148,22 @@ protected:
*/
FormulaToken* ReplaceToken( sal_uInt16 nOffset, FormulaToken*, ReplaceMode eMode );
+ /** Remove a sequence of tokens from pCode array, and pRPN array if the
+ tokens are referenced there.
+
+ This' nLen and nRPN are adapted, as is nIndex if it points behind
+ nOffset. If nIndex points into the to be removed range
+ (nOffset < nIndex < nOffset+nCount) it is set to nOffset+1.
+
+ @param nOffset
+ Start offset into pCode.
+ @param nCount
+ Count of tokens to remove.
+
+ @return The actual number of tokens removed from pCode array.
+ */
+ sal_uInt16 RemoveToken( sal_uInt16 nOffset, sal_uInt16 nCount );
+
inline void SetCombinedBitsRecalcMode( ScRecalcMode nBits )
{ nMode |= (nBits & ~RECALCMODE_EMASK); }
inline ScRecalcMode GetCombinedBitsRecalcMode() const