summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-11-07 19:12:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-11-08 08:41:06 +0100
commitcc9b55e8a8f8b8dbc81d17712cd848b1a6dfb206 (patch)
tree3d3fe2ca3b1e0bf620d8557548b03384e3be8105
parente4e9d1d8000321c6bcd591989f4ce4b68553cb86 (diff)
loplugin:reftotemp in basic
Change-Id: I41385d279cc81de9b5b2e9ff55b0b5c2f40aba66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176244 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--basic/source/classes/sb.cxx2
-rw-r--r--basic/source/classes/sbunoobj.cxx16
-rw-r--r--basic/source/classes/sbxmod.cxx6
-rw-r--r--basic/source/runtime/inputbox.cxx4
-rw-r--r--basic/source/runtime/methods.cxx56
-rw-r--r--basic/source/runtime/methods1.cxx6
-rw-r--r--basic/source/sbx/sbxarray.cxx2
-rw-r--r--basic/source/sbx/sbxcoll.cxx2
-rw-r--r--basic/source/sbx/sbxobj.cxx2
9 files changed, 48 insertions, 48 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 58ded6c8c3d1..ae9f4d0adeed 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1853,7 +1853,7 @@ std::pair<bool, sal_uInt32> StarBASIC::StoreData( SvStream& r ) const
r.WriteUInt16( static_cast<sal_uInt16>(pModules.size()));
for( const auto& rpModule: pModules )
{
- const auto& [bSuccessModule, nVersionModule] = rpModule->Store(r);
+ const auto [bSuccessModule, nVersionModule] = rpModule->Store(r);
if( !bSuccessModule )
{
return { false, 0 };
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 3199340e8b89..521c09e273b5 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -2613,19 +2613,19 @@ SbxVariable* SbUnoObject::Find( const OUString& rName, SbxClassType t )
}
if( mxUnoAccess->hasProperty( aUName, PropertyConcept::ALL - PropertyConcept::DANGEROUS ) )
{
- const Property& rProp = mxUnoAccess->
+ const Property aProp = mxUnoAccess->
getProperty( aUName, PropertyConcept::ALL - PropertyConcept::DANGEROUS );
// If the property could be void the type had to be set to Variant
SbxDataType eSbxType;
- if( rProp.Attributes & PropertyAttribute::MAYBEVOID )
+ if( aProp.Attributes & PropertyAttribute::MAYBEVOID )
eSbxType = SbxVARIANT;
else
- eSbxType = unoToSbxType( rProp.Type.getTypeClass() );
+ eSbxType = unoToSbxType( aProp.Type.getTypeClass() );
- SbxDataType eRealSbxType = ( ( rProp.Attributes & PropertyAttribute::MAYBEVOID ) ? unoToSbxType( rProp.Type.getTypeClass() ) : eSbxType );
+ SbxDataType eRealSbxType = ( ( aProp.Attributes & PropertyAttribute::MAYBEVOID ) ? unoToSbxType( aProp.Type.getTypeClass() ) : eSbxType );
// create the property and superimpose it
- auto pProp = tools::make_ref<SbUnoProperty>( rProp.Name, eSbxType, eRealSbxType, rProp, 0, false, ( rProp.Type.getTypeClass() == css::uno::TypeClass_STRUCT ) );
+ auto pProp = tools::make_ref<SbUnoProperty>( aProp.Name, eSbxType, eRealSbxType, aProp, 0, false, ( aProp.Type.getTypeClass() == css::uno::TypeClass_STRUCT ) );
QuickInsert( pProp.get() );
pRes = pProp.get();
}
@@ -2633,12 +2633,12 @@ SbxVariable* SbUnoObject::Find( const OUString& rName, SbxClassType t )
MethodConcept::ALL - MethodConcept::DANGEROUS ) )
{
// address the method
- const Reference< XIdlMethod >& rxMethod = mxUnoAccess->
+ const Reference< XIdlMethod > xMethod = mxUnoAccess->
getMethod( aUName, MethodConcept::ALL - MethodConcept::DANGEROUS );
// create SbUnoMethod and superimpose it
- auto xMethRef = tools::make_ref<SbUnoMethod>( rxMethod->getName(),
- unoToSbxType( rxMethod->getReturnType() ), rxMethod, false );
+ auto xMethRef = tools::make_ref<SbUnoMethod>( xMethod->getName(),
+ unoToSbxType( xMethod->getReturnType() ), xMethod, false );
QuickInsert( xMethRef.get() );
pRes = xMethRef.get();
}
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 1120207b5906..77eb427e5b49 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1630,7 +1630,7 @@ std::pair<bool, sal_uInt32> SbModule::StoreData( SvStream& rStrm ) const
bool bFixup = ( pImage && !pImage->ExceedsLegacyLimits() );
if ( bFixup )
fixUpMethodStart( true );
- const auto& [bSuccess, nVersion] = SbxObject::StoreData(rStrm);
+ const auto [bSuccess, nVersion] = SbxObject::StoreData(rStrm);
if (!bSuccess)
return { false, 0 };
@@ -1761,7 +1761,7 @@ void SbModule::StoreBinaryData( SvStream& rStrm )
if (!Compile())
return;
- const auto& [bSuccess, nVersion] = SbxObject::StoreData(rStrm);
+ const auto [bSuccess, nVersion] = SbxObject::StoreData(rStrm);
if (!bSuccess)
return;
@@ -1913,7 +1913,7 @@ bool SbJScriptModule::LoadData( SvStream& rStrm, sal_uInt16 )
std::pair<bool, sal_uInt32> SbJScriptModule::StoreData( SvStream& rStrm ) const
{
- const auto& [bSuccess, nVersion] = SbxObject::StoreData(rStrm);
+ const auto [bSuccess, nVersion] = SbxObject::StoreData(rStrm);
if( !bSuccess )
return { false, 0 };
diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx
index 134c1a0759c7..5f55aceb98b3 100644
--- a/basic/source/runtime/inputbox.cxx
+++ b/basic/source/runtime/inputbox.cxx
@@ -118,7 +118,7 @@ void SbRtl_InputBox(StarBASIC *, SbxArray & rPar, bool)
OUString aTitle;
OUString aDefault;
sal_Int32 nX = -1, nY = -1; // center
- const OUString& rPrompt = rPar.Get(1)->GetOUString();
+ const OUString aPrompt = rPar.Get(1)->GetOUString();
if (nArgCount > 2 && !rPar.Get(2)->IsErr())
aTitle = rPar.Get(2)->GetOUString();
if (nArgCount > 3 && !rPar.Get(3)->IsErr())
@@ -133,7 +133,7 @@ void SbRtl_InputBox(StarBASIC *, SbxArray & rPar, bool)
nX = rPar.Get(4)->GetLong();
nY = rPar.Get(5)->GetLong();
}
- SvRTLInputBox aDlg(Application::GetDefDialogParent(), rPrompt, aTitle, aDefault, nX, nY);
+ SvRTLInputBox aDlg(Application::GetDefDialogParent(), aPrompt, aTitle, aDefault, nX, nY);
aDlg.run();
rPar.Get(0)->PutString(aDlg.GetText());
}
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 597537385c7c..de36b63f4356 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -819,17 +819,17 @@ void SbRtl_InStr(StarBASIC *, SbxArray & rPar, bool)
bTextMode = rPar.Get(4)->GetInteger();
}
sal_Int32 nPos;
- const OUString& rToken = rPar.Get(nFirstStringPos + 1)->GetOUString();
+ const OUString aToken = rPar.Get(nFirstStringPos + 1)->GetOUString();
// #97545 Always find empty string
- if( rToken.isEmpty() )
+ if( aToken.isEmpty() )
{
nPos = nStartPos;
}
else
{
- const OUString& rStr1 = rPar.Get(nFirstStringPos)->GetOUString();
- const sal_Int32 nrStr1Len = rStr1.getLength();
+ const OUString aStr1 = rPar.Get(nFirstStringPos)->GetOUString();
+ const sal_Int32 nrStr1Len = aStr1.getLength();
if (nStartPos > nrStr1Len)
{
// Start position is greater than the string being searched
@@ -839,20 +839,20 @@ void SbRtl_InStr(StarBASIC *, SbxArray & rPar, bool)
{
if( !bTextMode )
{
- nPos = rStr1.indexOf( rToken, nStartPos - 1 ) + 1;
+ nPos = aStr1.indexOf( aToken, nStartPos - 1 ) + 1;
}
else
{
// tdf#139840 - case-insensitive operation for non-ASCII characters
i18nutil::SearchOptions2 aSearchOptions;
- aSearchOptions.searchString = rToken;
+ aSearchOptions.searchString = aToken;
aSearchOptions.AlgorithmType2 = util::SearchAlgorithms2::ABSOLUTE;
aSearchOptions.transliterateFlags |= TransliterationFlags::IGNORE_CASE;
utl::TextSearch textSearch(aSearchOptions);
sal_Int32 nStart = nStartPos - 1;
sal_Int32 nEnd = nrStr1Len;
- nPos = textSearch.SearchForward(rStr1, &nStart, &nEnd) ? nStart + 1 : 0;
+ nPos = textSearch.SearchForward(aStr1, &nStart, &nEnd) ? nStart + 1 : 0;
}
}
}
@@ -1261,19 +1261,19 @@ void SbRtl_Right(StarBASIC *, SbxArray & rPar, bool)
if (rPar.Count() < 3)
return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
- const OUString& rStr = rPar.Get(1)->GetOUString();
+ const OUString aStr = rPar.Get(1)->GetOUString();
int nResultLen = rPar.Get(2)->GetLong();
if( nResultLen < 0 )
{
nResultLen = 0;
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
}
- int nStrLen = rStr.getLength();
+ int nStrLen = aStr.getLength();
if ( nResultLen > nStrLen )
{
nResultLen = nStrLen;
}
- OUString aResultStr = rStr.copy( nStrLen - nResultLen );
+ OUString aResultStr = aStr.copy( nStrLen - nResultLen );
rPar.Get(0)->PutString(aResultStr);
}
@@ -1413,8 +1413,8 @@ void SbRtl_StrComp(StarBASIC *, SbxArray & rPar, bool)
rPar.Get(0)->PutEmpty();
return;
}
- const OUString& rStr1 = rPar.Get(1)->GetOUString();
- const OUString& rStr2 = rPar.Get(2)->GetOUString();
+ const OUString aStr1 = rPar.Get(1)->GetOUString();
+ const OUString aStr2 = rPar.Get(2)->GetOUString();
SbiInstance* pInst = GetSbData()->pInst;
bool bTextCompare;
@@ -1452,12 +1452,12 @@ void SbRtl_StrComp(StarBASIC *, SbxArray & rPar, bool)
LanguageType eLangType = Application::GetSettings().GetLanguageTag().getLanguageType();
pTransliterationWrapper->loadModuleIfNeeded( eLangType );
- nRetValue = pTransliterationWrapper->compareString( rStr1, rStr2 );
+ nRetValue = pTransliterationWrapper->compareString( aStr1, aStr2 );
}
else
{
sal_Int32 aResult;
- aResult = rStr1.compareTo( rStr2 );
+ aResult = aStr1.compareTo( aStr2 );
if ( aResult < 0 )
{
nRetValue = -1;
@@ -1490,8 +1490,8 @@ void SbRtl_String(StarBASIC *, SbxArray & rPar, bool)
}
else
{
- const OUString& rStr = rPar.Get(2)->GetOUString();
- aFiller = rStr[0];
+ const OUString aStr = rPar.Get(2)->GetOUString();
+ aFiller = aStr[0];
}
OUStringBuffer aBuf(lCount);
string::padToLength(aBuf, lCount, aFiller);
@@ -3716,8 +3716,8 @@ void SbRtl_Len(StarBASIC *, SbxArray & rPar, bool)
}
else
{
- const OUString& rStr = rPar.Get(1)->GetOUString();
- rPar.Get(0)->PutLong(rStr.getLength());
+ const OUString aStr = rPar.Get(1)->GetOUString();
+ rPar.Get(0)->PutLong(aStr.getLength());
}
}
@@ -3728,12 +3728,12 @@ void SbRtl_DDEInitiate(StarBASIC *, SbxArray & rPar, bool)
{
return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
}
- const OUString& rApp = rPar.Get(1)->GetOUString();
- const OUString& rTopic = rPar.Get(2)->GetOUString();
+ const OUString aApp = rPar.Get(1)->GetOUString();
+ const OUString aTopic = rPar.Get(2)->GetOUString();
SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl();
size_t nChannel;
- ErrCode nDdeErr = pDDE->Initiate( rApp, rTopic, nChannel );
+ ErrCode nDdeErr = pDDE->Initiate( aApp, aTopic, nChannel );
if( nDdeErr )
{
StarBASIC::Error( nDdeErr );
@@ -3787,10 +3787,10 @@ void SbRtl_DDERequest(StarBASIC *, SbxArray & rPar, bool)
return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
}
size_t nChannel = rPar.Get(1)->GetInteger();
- const OUString& rItem = rPar.Get(2)->GetOUString();
+ const OUString aItem = rPar.Get(2)->GetOUString();
SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl();
OUString aResult;
- ErrCode nDdeErr = pDDE->Request( nChannel, rItem, aResult );
+ ErrCode nDdeErr = pDDE->Request( nChannel, aItem, aResult );
if( nDdeErr )
{
StarBASIC::Error( nDdeErr );
@@ -3810,9 +3810,9 @@ void SbRtl_DDEExecute(StarBASIC *, SbxArray & rPar, bool)
return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
}
size_t nChannel = rPar.Get(1)->GetInteger();
- const OUString& rCommand = rPar.Get(2)->GetOUString();
+ const OUString aCommand = rPar.Get(2)->GetOUString();
SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl();
- ErrCode nDdeErr = pDDE->Execute( nChannel, rCommand );
+ ErrCode nDdeErr = pDDE->Execute( nChannel, aCommand );
if( nDdeErr )
{
StarBASIC::Error( nDdeErr );
@@ -3828,10 +3828,10 @@ void SbRtl_DDEPoke(StarBASIC *, SbxArray & rPar, bool)
return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
}
size_t nChannel = rPar.Get(1)->GetInteger();
- const OUString& rItem = rPar.Get(2)->GetOUString();
- const OUString& rData = rPar.Get(3)->GetOUString();
+ const OUString aItem = rPar.Get(2)->GetOUString();
+ const OUString aData = rPar.Get(3)->GetOUString();
SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl();
- ErrCode nDdeErr = pDDE->Poke( nChannel, rItem, rData );
+ ErrCode nDdeErr = pDDE->Poke( nChannel, aItem, aData );
if( nDdeErr )
{
StarBASIC::Error( nDdeErr );
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 8787ca4dc430..ffdd1ce661b9 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -881,20 +881,20 @@ static bool lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm,
case SbxSTRING:
case SbxLPSTR:
{
- const OUString& rStr = rVar.GetOUString();
+ const OUString aStr = rVar.GetOUString();
if( !bBinary || bIsArray )
{
if( bIsVariant )
{
pStrm->WriteUInt16( SbxSTRING );
}
- pStrm->WriteUniOrByteString( rStr, osl_getThreadTextEncoding() );
+ pStrm->WriteUniOrByteString( aStr, osl_getThreadTextEncoding() );
}
else
{
// without any length information! without end-identifier!
// What does that mean for Unicode?! Choosing conversion to ByteString...
- OString aByteStr(OUStringToOString(rStr, osl_getThreadTextEncoding()));
+ OString aByteStr(OUStringToOString(aStr, osl_getThreadTextEncoding()));
pStrm->WriteOString( aByteStr );
}
}
diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx
index f4025745e3d0..5be00ebf010d 100644
--- a/basic/source/sbx/sbxarray.cxx
+++ b/basic/source/sbx/sbxarray.cxx
@@ -376,7 +376,7 @@ std::pair<bool, sal_uInt32> SbxArray::StoreData( SvStream& rStrm ) const
if (rEntry.mpVar.is() && !(rEntry.mpVar->GetFlags() & SbxFlagBits::DontStore))
{
rStrm.WriteUInt16( n );
- const auto& [bSuccess, nVersionModule] = rEntry.mpVar->Store(rStrm);
+ const auto [bSuccess, nVersionModule] = rEntry.mpVar->Store(rStrm);
if (!bSuccess)
return { false, 0 };
else if (nVersionModule > nVersion)
diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx
index 0bb315c496a8..8b74d79bc194 100644
--- a/basic/source/sbx/sbxcoll.cxx
+++ b/basic/source/sbx/sbxcoll.cxx
@@ -290,7 +290,7 @@ bool SbxStdCollection::LoadData( SvStream& rStrm, sal_uInt16 nVer )
std::pair<bool, sal_uInt32> SbxStdCollection::StoreData( SvStream& rStrm ) const
{
- const auto& [bRes, nVersion] = SbxCollection::StoreData(rStrm);
+ const auto [bRes, nVersion] = SbxCollection::StoreData(rStrm);
if( bRes )
{
write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aElemClass,
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index 0217d03ab520..3fc56112e9e8 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -621,7 +621,7 @@ std::pair<bool, sal_uInt32> SbxObject::StoreData( SvStream& rStrm ) const
rStrm.Seek( nPos );
rStrm.WriteUInt32( nNew - nPos );
rStrm.Seek( nNew );
- const auto& [bSuccess, nVersion] = pMethods->Store( rStrm );
+ const auto [bSuccess, nVersion] = pMethods->Store( rStrm );
if( !bSuccess )
{
return { false, 0 };