tdf#147132 : Flatten Basic function implementations

Flatten implementation of SbRtl_Weekday in basic/source/runtime/methods1.cxx.

Change-Id: I17931cfecc24be9c114daa9c6c221e6c00a4e3aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208256
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
This commit is contained in:
ApurvR20
2026-07-20 09:38:38 +02:00
committed by Neil Roberts
parent b336f57daf
commit 54b3494de7
+9 -13
View File
@@ -1621,22 +1621,18 @@ void SbRtl_Weekday(StarBASIC *, SbxArray & rPar, bool)
sal_uInt32 nParCount = rPar.Count();
if ( nParCount < 2 || nParCount > 3 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
}
else
double aDate = rPar.Get(1)->GetDate();
bool bFirstDay = false;
sal_Int16 nFirstDay = 0;
if ( nParCount > 2 )
{
double aDate = rPar.Get(1)->GetDate();
bool bFirstDay = false;
sal_Int16 nFirstDay = 0;
if ( nParCount > 2 )
{
nFirstDay = rPar.Get(2)->GetInteger();
bFirstDay = true;
}
sal_Int16 nDay = implGetWeekDay( aDate, bFirstDay, nFirstDay );
rPar.Get(0)->PutInteger(nDay);
nFirstDay = rPar.Get(2)->GetInteger();
bFirstDay = true;
}
sal_Int16 nDay = implGetWeekDay( aDate, bFirstDay, nFirstDay );
rPar.Get(0)->PutInteger(nDay);
}
namespace {