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 18:16:05 +0100
commitdee3bcdb9e91f338b66872ae939bf790ab7bf061 (patch)
treecdd22d6c354d27808eb385c7a5d0d3daedcfa33f
parentfe2c3a01f55afd48149ff801b0f1acec7a7f6856 (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 (cherry picked from commit 7ea839ae3904d96dcea35a0339f3e6ee7d58bbaa)
-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 :