summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-01-04 17:40:18 +0100
committerEike Rathke <erack@redhat.com>2016-01-04 17:42:23 +0100
commit7ea839ae3904d96dcea35a0339f3e6ee7d58bbaa (patch)
tree0cba0f29ff6dccdf1f2a403d792c0f70417c9d30
parentce814d1a28bb1ff2e6df23e6ed8c256c948787af (diff)
correct WEEKNUM DayOfWeek handling, tdf#50950 follow-up, tdf#95419 related
Slight misinterpretation of the {Sunday, Monday, Monday, Tuesday, ..., Sunday} sequence defined in ODFF. Change-Id: I09ac711adf8a52db1c9efbb1c67dc908b8e06618
-rw-r--r--sc/source/core/tool/interpr2.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index dbed2a79057c..1777230b1142 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -220,15 +220,21 @@ void ScInterpreter::ScGetWeekOfYear()
switch ( nFlag )
{
case 1 :
- case 11 :
+ eFirstDayOfWeek = SUNDAY;
+ nMinimumNumberOfDaysInWeek = 1;
+ break;
case 2 :
+ eFirstDayOfWeek = MONDAY;
+ nMinimumNumberOfDaysInWeek = 1;
+ break;
+ case 11 :
case 12 :
case 13 :
case 14 :
case 15 :
case 16 :
case 17 :
- eFirstDayOfWeek = (DayOfWeek) ( ( nFlag - 1 ) % 10 );
+ eFirstDayOfWeek = static_cast<DayOfWeek>( nFlag - 11 ); // MONDAY := 0
nMinimumNumberOfDaysInWeek = 1; //the week containing January 1 is week 1
break;
case 21 :