tdf#147132: Flatten Basic function implementations in methods1.cxx

Change-Id: I1107266b6a7b33ee3a9a0d69d850bf5b4c203692
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204798
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
This commit is contained in:
Furkan Ahmet Kara
2026-05-28 10:11:35 +02:00
committed by Neil Roberts
parent 9f50e5613b
commit 49d827b374
+12 -27
View File
@@ -212,45 +212,30 @@ void SbRtl_CallByName(StarBASIC *, SbxArray & rPar, bool)
void SbRtl_CBool(StarBASIC *, SbxArray & rPar, bool) // JSM
{
bool bVal = false;
if (rPar.Count() == 2)
{
SbxVariable* pSbxVariable = rPar.Get(1);
bVal = pSbxVariable->GetBool();
}
else
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
}
if (rPar.Count() != 2)
return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
SbxVariable* pSbxVariable = rPar.Get(1);
bVal = pSbxVariable->GetBool();
rPar.Get(0)->PutBool(bVal);
}
void SbRtl_CByte(StarBASIC *, SbxArray & rPar, bool) // JSM
{
sal_uInt8 nByte = 0;
if (rPar.Count() == 2)
{
SbxVariable* pSbxVariable = rPar.Get(1);
nByte = pSbxVariable->GetByte();
}
else
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
}
if (rPar.Count() != 2)
return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
SbxVariable* pSbxVariable = rPar.Get(1);
nByte = pSbxVariable->GetByte();
rPar.Get(0)->PutByte(nByte);
}
void SbRtl_CCur(StarBASIC *, SbxArray & rPar, bool)
{
sal_Int64 nCur = 0;
if (rPar.Count() == 2)
{
SbxVariable* pSbxVariable = rPar.Get(1);
nCur = pSbxVariable->GetCurrency();
}
else
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
}
if (rPar.Count() != 2)
return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
SbxVariable* pSbxVariable = rPar.Get(1);
nCur = pSbxVariable->GetCurrency();
rPar.Get(0)->PutCurrency(nCur);
}