summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorOmkarAcharekar <omkaracharekar12@gmail.com>2023-10-07 12:39:40 +0530
committerIlmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>2023-10-07 17:40:00 +0200
commit95df8cda94007e7e5b316a02176bed76259c21c4 (patch)
tree566bf3fa924ae72556dc146a971dec7ccfbdb9a8 /basic
parent280985ba383b56e3d64fa64f20cd4cc584fb8622 (diff)
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 <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/methods.cxx24
1 files changed, 8 insertions, 16 deletions
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)