diff options
author | Eike Rathke <erack@redhat.com> | 2016-01-04 15:41:32 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-01-04 15:59:06 +0100 |
commit | 1c5eb11d42ccdacdaf29e0b8f26c4f674069f227 (patch) | |
tree | e36b7e1336e97cf242dd050664a701f5c6d9bb7c /sc/source/core | |
parent | f14d64fa71565e86c98348f9c54cc6cab53649d8 (diff) |
WEEKNUM second parameter is optional defaulting to 1, tdf#50950 follow-up
Change-Id: I64b22f91bf56497b9f705e4773e24c5ba88a14ae
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/tool/interpr2.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index b7c503bd291b..dbed2a79057c 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -207,9 +207,10 @@ void ScInterpreter::ScGetDayOfWeek() void ScInterpreter::ScGetWeekOfYear() { - if ( MustHaveParamCount( GetByte(), 2 ) ) + sal_uInt8 nParamCount = GetByte(); + if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { - short nFlag = (short) ::rtl::math::approxFloor(GetDouble()); + short nFlag = (nParamCount == 1) ? 1 : (short) ::rtl::math::approxFloor(GetDouble()); Date aDate = *(pFormatter->GetNullDate()); aDate += (long)::rtl::math::approxFloor(GetDouble()); |