diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-26 17:16:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-27 11:35:24 +0200 |
commit | b83cc2b0108a4ec2087221a6150a66578788e5b4 (patch) | |
tree | b3684057b66602ddf01546dcb8306fddbad69a38 /basic | |
parent | 86be39afd5b142f7cbdbe0107b394c5924c414cc (diff) |
loplugin:stringloop in basic, framework, sax, svtools
Change-Id: I2bad74a8f103e9dc68c8e0d0e6315697068d2f6d
Reviewed-on: https://gerrit.libreoffice.org/58135
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/comp/codegen.cxx | 8 | ||||
-rw-r--r-- | basic/source/runtime/methods1.cxx | 8 | ||||
-rw-r--r-- | basic/source/sbx/sbxexec.cxx | 6 | ||||
-rw-r--r-- | basic/source/sbx/sbxvar.cxx | 30 |
4 files changed, 26 insertions, 26 deletions
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index 4e13f6a83336..fc234dfa1579 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -189,7 +189,7 @@ void SbiCodeGen::Save() if( pProc && pProc->IsDefined() ) { OUString aProcName = pProc->GetName(); - OUString aIfaceProcName; + OUStringBuffer aIfaceProcName; OUString aIfaceName; sal_uInt16 nPassCount = 1; if( nIfaceCount ) @@ -210,9 +210,9 @@ void SbiCodeGen::Save() { if( nPropPrefixFound == 0 ) { - aIfaceProcName += aPropPrefix; + aIfaceProcName.append(aPropPrefix); } - aIfaceProcName += aPureProcName.copy( rIfaceName.getLength() + 1 ); + aIfaceProcName.append(aPureProcName.copy( rIfaceName.getLength() + 1 )); aIfaceName = rIfaceName; nPassCount = 2; break; @@ -224,7 +224,7 @@ void SbiCodeGen::Save() { if( nPass == 1 ) { - aProcName = aIfaceProcName; + aProcName = aIfaceProcName.toString(); } PropertyMode ePropMode = pProc->getPropertyMode(); if( ePropMode != PropertyMode::NONE ) diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 8c8c3dcbcd7d..4b59ea081c28 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -1550,20 +1550,20 @@ void SbRtl_Join(StarBASIC *, SbxArray & rPar, bool) { aDelim = " "; } - OUString aRetStr; + OUStringBuffer aRetStr; short nLower, nUpper; pArr->GetDim( 1, nLower, nUpper ); short aIdx[1]; for (aIdx[0] = nLower; aIdx[0] <= nUpper; ++aIdx[0]) { OUString aStr = pArr->Get(aIdx)->GetOUString(); - aRetStr += aStr; + aRetStr.append(aStr); if (aIdx[0] != nUpper) { - aRetStr += aDelim; + aRetStr.append(aDelim); } } - rPar.Get(0)->PutString( aRetStr ); + rPar.Get(0)->PutString( aRetStr.makeStringAndClear() ); } else { diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx index a74cdf5c2655..7f177c27814d 100644 --- a/basic/source/sbx/sbxexec.cxx +++ b/basic/source/sbx/sbxexec.cxx @@ -140,7 +140,7 @@ static SbxVariableRef Operand else if( !bVar && *p == '"' ) { // A string - OUString aString; + OUStringBuffer aString; p++; for( ;; ) { @@ -157,9 +157,9 @@ static SbxVariableRef Operand break; } } - aString += OUStringLiteral1(*p++); + aString.append(*p++); } - refVar->PutString( aString ); + refVar->PutString( aString.makeStringAndClear() ); } else { diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 59751d4d6288..3172cf5f686e 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -233,7 +233,7 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const return maName; } sal_Unicode cType = ' '; - OUString aTmp( maName ); + OUStringBuffer aTmp( maName ); // short type? Then fetch it, possible this is 0. SbxDataType et = GetType(); if( t == SbxNameType::ShortTypes ) @@ -244,10 +244,10 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const } if( cType != ' ' ) { - aTmp += OUStringLiteral1(cType); + aTmp.append(cType); } } - aTmp += "("; + aTmp.append("("); for (SbxParams::const_iterator iter = pInfo->m_Params.begin(); iter != pInfo->m_Params.end(); ++iter) { @@ -255,17 +255,17 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const int nt = i->eType & 0x0FFF; if (iter != pInfo->m_Params.begin()) { - aTmp += ","; + aTmp.append(","); } if( i->nFlags & SbxFlagBits::Optional ) { - aTmp += GetSbxRes( StringId::Optional ); + aTmp.append( GetSbxRes( StringId::Optional ) ); } if( i->eType & SbxBYREF ) { - aTmp += GetSbxRes( StringId::ByRef ); + aTmp.append( GetSbxRes( StringId::ByRef ) ); } - aTmp += i->aName; + aTmp.append( i->aName ); cType = ' '; // short type? Then fetch it, possible this is 0. if( t == SbxNameType::ShortTypes ) @@ -277,32 +277,32 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const } if( cType != ' ' ) { - aTmp += OUStringLiteral1(cType); + aTmp.append(cType); if( i->eType & SbxARRAY ) { - aTmp += "()"; + aTmp.append("()"); } } else { if( i->eType & SbxARRAY ) { - aTmp += "()"; + aTmp.append("()"); } // long type? - aTmp += GetSbxRes( StringId::As ); + aTmp.append(GetSbxRes( StringId::As )); if( nt < 32 ) { - aTmp += GetSbxRes( static_cast<StringId>( static_cast<int>( StringId::Types ) + nt ) ); + aTmp.append(GetSbxRes( static_cast<StringId>( static_cast<int>( StringId::Types ) + nt ) )); } else { - aTmp += GetSbxRes( StringId::Any ); + aTmp.append(GetSbxRes( StringId::Any )); } } } - aTmp += ")"; - const_cast<SbxVariable*>(this)->aToolString = aTmp; + aTmp.append(")"); + const_cast<SbxVariable*>(this)->aToolString = aTmp.makeStringAndClear(); return aToolString; } |