[Libreoffice-commits] core.git: sc/source
Eike Rathke
erack at redhat.com
Mon Jan 4 08:43:27 PST 2016
sc/source/core/tool/interpr2.cxx | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 7ea839ae3904d96dcea35a0339f3e6ee7d58bbaa
Author: Eike Rathke <erack at redhat.com>
Date: Mon Jan 4 17:40:18 2016 +0100
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
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index dbed2a7..1777230 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 :
More information about the Libreoffice-commits
mailing list