summaryrefslogtreecommitdiff
path: root/basic/source/runtime
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-01 14:01:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-01 16:12:20 +0200
commit38786f1df9ed8324a44c9f2afacb245744b54ebc (patch)
tree0d346ab1653836a2ac8beebcefa1ecabd005958b /basic/source/runtime
parent18d4e89fdd63479e20d096c3a578153aa4328aee (diff)
loplugin:reducevarscope in basctl,basic
Change-Id: I32595921bf5ed26699bced3637302692c407d624 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103760 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic/source/runtime')
-rw-r--r--basic/source/runtime/methods.cxx3
-rw-r--r--basic/source/runtime/runtime.cxx7
2 files changed, 4 insertions, 6 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 78dcbf5097d6..3e8f8d23cd42 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -4107,8 +4107,6 @@ void SbRtl_StrConv(StarBASIC *, SbxArray & rPar, bool)
OUString aOldStr = rPar.Get32(1)->GetOUString();
sal_Int32 nConversion = rPar.Get32(2)->GetLong();
- LanguageType nLanguage = LANGUAGE_SYSTEM;
-
sal_Int32 nOldLen = aOldStr.getLength();
if( nOldLen == 0 )
{
@@ -4153,6 +4151,7 @@ void SbRtl_StrConv(StarBASIC *, SbxArray & rPar, bool)
uno::Reference< uno::XComponentContext > xContext = getProcessComponentContext();
::utl::TransliterationWrapper aTransliterationWrapper( xContext, nType );
uno::Sequence<sal_Int32> aOffsets;
+ LanguageType nLanguage = LANGUAGE_SYSTEM;
aTransliterationWrapper.loadModuleIfNeeded( nLanguage );
aNewStr = aTransliterationWrapper.transliterate( aOldStr, nLanguage, 0, nOldLen, &aOffsets );
}
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 89fc75f31e8e..498c71628dba 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -784,7 +784,7 @@ bool SbiRuntime::Step()
}
SbiOpcode eOp = static_cast<SbiOpcode>( *pCode++ );
- sal_uInt32 nOp1, nOp2;
+ sal_uInt32 nOp1;
if (eOp <= SbiOpcode::SbOP0_END)
{
(this->*( aStep0[ int(eOp) ] ) )();
@@ -798,7 +798,7 @@ bool SbiRuntime::Step()
else if (eOp >= SbiOpcode::SbOP2_START && eOp <= SbiOpcode::SbOP2_END)
{
nOp1 = *pCode++; nOp1 |= *pCode++ << 8; nOp1 |= *pCode++ << 16; nOp1 |= *pCode++ << 24;
- nOp2 = *pCode++; nOp2 |= *pCode++ << 8; nOp2 |= *pCode++ << 16; nOp2 |= *pCode++ << 24;
+ sal_uInt32 nOp2 = *pCode++; nOp2 |= *pCode++ << 8; nOp2 |= *pCode++ << 16; nOp2 |= *pCode++ << 24;
(this->*( aStep2[ int(eOp) - int(SbiOpcode::SbOP2_START) ] ) )( nOp1, nOp2 );
}
else
@@ -2430,7 +2430,6 @@ void SbiRuntime::StepARGV()
void SbiRuntime::StepINPUT()
{
OUStringBuffer sin;
- OUString s;
char ch = 0;
ErrCode err;
// Skip whitespace
@@ -2482,7 +2481,7 @@ void SbiRuntime::StepINPUT()
}
if( !err )
{
- s = sin.makeStringAndClear();
+ OUString s = sin.makeStringAndClear();
SbxVariableRef pVar = GetTOS();
// try to fill the variable with a numeric value first,
// then with a string value