summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-14 14:54:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-14 16:17:55 +0200
commit14471a694271777440c19916055d659337c0fb8d (patch)
tree50f889a9cee6caa123501a40a06d3b1a2030bf41 /basic
parente6b8be25a6fb5afbd1649489318a7a2d7ae62efa (diff)
loplugin:buriedassign in b*
Change-Id: Ic20f46105a30b54bc5a991b4070e6c8edb15376e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92189 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/comp/exprtree.cxx3
-rw-r--r--basic/source/comp/token.cxx44
-rw-r--r--basic/source/runtime/runtime.cxx11
-rw-r--r--basic/source/uno/namecont.cxx6
4 files changed, 43 insertions, 21 deletions
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index 4fe389983d28..cd6094db736b 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -210,7 +210,8 @@ std::unique_ptr<SbiExprNode> SbiExpression::Term( const KeywordSymbolInfo* pKeyw
bError = true;
}
- if( DoParametersFollow( pParser, eCurExpr, eTok = eNextTok ) )
+ eTok = eNextTok;
+ if( DoParametersFollow( pParser, eCurExpr, eTok ) )
{
bool bStandaloneExpression = (m_eMode == EXPRMODE_STANDALONE);
pPar = SbiExprList::ParseParameters( pParser, bStandaloneExpression );
diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx
index 92fabfe98ddd..37c8f9b3a475 100644
--- a/basic/source/comp/token.cxx
+++ b/basic/source/comp/token.cxx
@@ -259,7 +259,8 @@ SbiToken SbiTokenizer::Peek()
nPCol1 = nCol1; nCol1 = nOldCol1;
nPCol2 = nCol2; nCol2 = nOldCol2;
}
- return eCurTok = ePush;
+ eCurTok = ePush;
+ return eCurTok;
}
// For decompilation. Numbers and symbols return an empty string.
@@ -329,44 +330,54 @@ SbiToken SbiTokenizer::Next()
if( !NextSym() )
{
bEof = bEos = true;
- return eCurTok = EOLN;
+ eCurTok = EOLN;
+ return eCurTok;
}
if( aSym.startsWith("\n") )
{
bEos = true;
- return eCurTok = EOLN;
+ eCurTok = EOLN;
+ return eCurTok;
}
bEos = false;
if( bNumber )
{
- return eCurTok = NUMBER;
+ eCurTok = NUMBER;
+ return eCurTok;
}
else if( ( eScanType == SbxDATE || eScanType == SbxSTRING ) && !bSymbol )
{
- return eCurTok = FIXSTRING;
+ eCurTok = FIXSTRING;
+ return eCurTok;
}
else if( aSym.isEmpty() )
{
//something went wrong
bEof = bEos = true;
- return eCurTok = EOLN;
+ eCurTok = EOLN;
+ return eCurTok;
}
// Special cases of characters that are between "Z" and "a". ICompare()
// evaluates the position of these characters in different ways.
else if( aSym[0] == '^' )
{
- return eCurTok = EXPON;
+ eCurTok = EXPON;
+ return eCurTok;
}
else if( aSym[0] == '\\' )
{
- return eCurTok = IDIV;
+ eCurTok = IDIV;
+ return eCurTok;
}
else
{
if( eScanType != SbxVARIANT )
- return eCurTok = SYMBOL;
+ {
+ eCurTok = SYMBOL;
+ return eCurTok;
+ }
// valid token?
short lb = 0;
short ub = SAL_N_ELEMENTS(aTokTable_Basic)-1;
@@ -409,9 +420,11 @@ SbiToken SbiTokenizer::Next()
sal_Unicode ch = aSym[0];
if( !BasicCharClass::isAlpha( ch, bCompatible ) && !bSymbol )
{
- return eCurTok = static_cast<SbiToken>(ch & 0x00FF);
+ eCurTok = static_cast<SbiToken>(ch & 0x00FF);
+ return eCurTok;
}
- return eCurTok = SYMBOL;
+ eCurTok = SYMBOL;
+ return eCurTok;
}
special:
// #i92642
@@ -419,11 +432,13 @@ special:
eCurTok == THEN || eCurTok == ELSE); // single line If
if( !bStartOfLine && (tp->t == NAME || tp->t == LINE) )
{
- return eCurTok = SYMBOL;
+ eCurTok = SYMBOL;
+ return eCurTok;
}
else if( tp->t == TEXT )
{
- return eCurTok = SYMBOL;
+ eCurTok = SYMBOL;
+ return eCurTok;
}
// maybe we can expand this for other statements that have parameters
// that are keywords ( and those keywords are only used within such
@@ -434,7 +449,8 @@ special:
// Also we accept Dim APPEND
else if ( ( !bInStatement || eCurTok == DIM ) && tp->t == APPEND )
{
- return eCurTok = SYMBOL;
+ eCurTok = SYMBOL;
+ return eCurTok;
}
// #i92642: Special LINE token handling -> SbiParser::Line()
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 279f26f48971..9d81ea52c62d 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -3221,11 +3221,14 @@ bool SbiRuntime::implIsClass( SbxObject const * pObj, const OUString& aClass )
{
const OUString& aObjClass = pObj->GetClassName();
SbModule* pClassMod = GetSbData()->pClassFac->FindClass( aObjClass );
- SbClassData* pClassData;
- if( pClassMod && (pClassData=pClassMod->pClassData.get()) != nullptr )
+ if( pClassMod )
{
- SbxVariable* pClassVar = pClassData->mxIfaces->Find( aClass, SbxClassType::DontCare );
- bRet = (pClassVar != nullptr);
+ SbClassData* pClassData = pClassMod->pClassData.get();
+ if (pClassData != nullptr )
+ {
+ SbxVariable* pClassVar = pClassData->mxIfaces->Find( aClass, SbxClassType::DontCare );
+ bRet = (pClassVar != nullptr);
+ }
}
}
}
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 179df9b3d009..6a510e0cc313 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -1215,11 +1215,13 @@ void SfxLibraryContainer::implScanExtensions()
{
#if HAVE_FEATURE_EXTENSIONS
ScriptExtensionIterator aScriptIt;
- OUString aLibURL;
bool bPureDialogLib = false;
- while ( !(aLibURL = aScriptIt.nextBasicOrDialogLibrary( bPureDialogLib )).isEmpty())
+ for (;;)
{
+ OUString aLibURL = aScriptIt.nextBasicOrDialogLibrary( bPureDialogLib );
+ if (aLibURL.isEmpty())
+ break;
if( bPureDialogLib && maInfoFileName == "script" )
{
continue;