summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-01-04 15:41:32 +0100
committerEike Rathke <erack@redhat.com>2016-01-04 16:59:57 +0100
commitb4e3bb593de910463f873c46b1ff212e43ba0993 (patch)
tree1e6e9f7f1e8d107572756a75ffbdc37c8ce6c97f
parent2a5b22091443ad00f6d8843b652bc5b8535a8d13 (diff)
WEEKNUM second parameter is optional defaulting to 1, tdf#50950 follow-up
Change-Id: I64b22f91bf56497b9f705e4773e24c5ba88a14ae (cherry picked from commit 1c5eb11d42ccdacdaf29e0b8f26c4f674069f227)
-rw-r--r--sc/source/core/tool/interpr2.cxx5
-rw-r--r--sc/source/ui/src/scfuncs.src2
2 files changed, 4 insertions, 3 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());
diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index 44287c4dd1c1..ca8fbee0296a 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -1168,7 +1168,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1
0;
ID_FUNCTION_GRP_DATETIME;
U2S( HID_FUNC_KALENDERWOCHE );
- 2; 0; 0;
+ 2; 0; 1;
0;
};
String 2 // Name of Parameter 1