[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - sc/source

Eike Rathke erack at redhat.com
Mon Jan 4 09:17:09 PST 2016


 sc/source/core/tool/interpr2.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit dee3bcdb9e91f338b66872ae939bf790ab7bf061
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
    (cherry picked from commit 7ea839ae3904d96dcea35a0339f3e6ee7d58bbaa)

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