From 95df8cda94007e7e5b316a02176bed76259c21c4 Mon Sep 17 00:00:00 2001 From: OmkarAcharekar Date: Sat, 7 Oct 2023 12:39:40 +0530 Subject: tdf#147132 Flatten Basic function implementations Change-Id: I91ab40003011a7c537faa40daf3db85a13946c69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157669 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas Reviewed-by: Ilmari Lauhakangas --- basic/source/runtime/methods.cxx | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'basic') diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 8bfb362f98c9..2e84e964d0be 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -1046,14 +1046,10 @@ void SbRtl_Log(StarBASIC *, SbxArray & rPar, bool) void SbRtl_LTrim(StarBASIC *, SbxArray & rPar, bool) { if (rPar.Count() < 2) - { - StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); - } - else - { - OUString aStr(comphelper::string::stripStart(rPar.Get(1)->GetOUString(), ' ')); - rPar.Get(0)->PutString(aStr); - } + return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + + OUString aStr(comphelper::string::stripStart(rPar.Get(1)->GetOUString(), ' ')); + rPar.Get(0)->PutString(aStr); } @@ -1318,14 +1314,10 @@ void SbRtl_RTL(StarBASIC * pBasic, SbxArray & rPar, bool) void SbRtl_RTrim(StarBASIC *, SbxArray & rPar, bool) { if (rPar.Count() < 2) - { - StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); - } - else - { - OUString aStr(comphelper::string::stripEnd(rPar.Get(1)->GetOUString(), ' ')); - rPar.Get(0)->PutString(aStr); - } + return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + + OUString aStr(comphelper::string::stripEnd(rPar.Get(1)->GetOUString(), ' ')); + rPar.Get(0)->PutString(aStr); } void SbRtl_Sgn(StarBASIC *, SbxArray & rPar, bool) -- cgit