summaryrefslogtreecommitdiff
path: root/include/formula
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-01-05 19:13:54 +0100
committerEike Rathke <erack@redhat.com>2016-01-05 19:29:17 +0100
commit902c593196741ffec2d096855369313f6bbe756e (patch)
tree2a0555aec7de54dff4239dbd94090531340d4e82 /include/formula
parent5f981642889b1b9980e98ebccc3150e022a73bed (diff)
tdf#96198 add WEEKNUM_OOO compatibility function, tdf#50950 follow-up
The remaining cases when loading old and wrong ISOWEEKNUM that can't be mapped to either new WEEKNUM or ISOWEEKNUM now are mapped to WEEKNUM_OOO(date,mode) with calculations identical to the old and wrong OOo WEEKNUM. These WEEKNUM_OOO cases are still wrongly saved as ISOWEEKNUM so can be read by 5.0 or earlier versions as the old WEEKNUM, which should be changed for 5.3 or later. WEEKNUM_OOO is not offered in the Function Wizard to prevent deliberate usage. Also reverts the interim unit test change to sc/qa/unit/data/contentCSV/date-time-functions.csv that was necessary to catch the error generated by ISOWEEKNUM with two arguments. Change-Id: I874c4c7225900f03b879f2947512ae02270cbd4f
Diffstat (limited to 'include/formula')
-rw-r--r--include/formula/compiler.hrc3
-rw-r--r--include/formula/opcode.hxx1
2 files changed, 3 insertions, 1 deletions
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 5e8f7b568ce9..a6a54913daa7 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -486,7 +486,8 @@
#define SC_OPCODE_FLOOR_MATH 475
#define SC_OPCODE_FLOOR_PRECISE 476
#define SC_OPCODE_RAWSUBTRACT 477
-#define SC_OPCODE_STOP_2_PAR 478 /* last function with two or more parameters' OpCode + 1 */
+#define SC_OPCODE_WEEKNUM_OOO 478
+#define SC_OPCODE_STOP_2_PAR 479 /* last function with two or more parameters' OpCode + 1 */
#define SC_OPCODE_STOP_FUNCTION SC_OPCODE_STOP_2_PAR /* last function's OpCode + 1 */
#define SC_OPCODE_LAST_OPCODE_ID (SC_OPCODE_STOP_FUNCTION - 1) /* last OpCode */
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index a767dfcc3a06..61237332fc85 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -451,6 +451,7 @@ enum OpCode : sal_uInt16
// miscellaneous
ocWeek = SC_OPCODE_WEEK,
ocIsoWeeknum = SC_OPCODE_ISOWEEKNUM,
+ ocWeeknumOOo = SC_OPCODE_WEEKNUM_OOO,
ocGetDayOfWeek = SC_OPCODE_GET_DAY_OF_WEEK,
ocNetWorkdays = SC_OPCODE_NETWORKDAYS,
ocNetWorkdays_MS = SC_OPCODE_NETWORKDAYS_MS,