loplugin:passstuffbyref in basic
Change-Id: I1aee08f0ff2a3dabcedc49a31e7ff4de9428007e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176136 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -1215,14 +1215,14 @@ bool BasicManager::HasLib( std::u16string_view rName ) const
|
||||
return false;
|
||||
}
|
||||
|
||||
OUString BasicManager::GetLibName( sal_uInt16 nLib )
|
||||
const OUString & BasicManager::GetLibName( sal_uInt16 nLib )
|
||||
{
|
||||
DBG_ASSERT( nLib < maLibs.size(), "Lib?!" );
|
||||
if ( nLib < maLibs.size() )
|
||||
{
|
||||
return maLibs[nLib]->GetLibName();
|
||||
}
|
||||
return OUString();
|
||||
return EMPTY_OUSTRING;
|
||||
}
|
||||
|
||||
bool BasicManager::LoadLib( sal_uInt16 nLib )
|
||||
|
@@ -1712,7 +1712,7 @@ ErrCode StarBASIC::GetErrBasic()
|
||||
}
|
||||
|
||||
// make the additional message for the RTL function error accessible
|
||||
OUString StarBASIC::GetErrorMsg()
|
||||
const OUString & StarBASIC::GetErrorMsg()
|
||||
{
|
||||
if( GetSbData()->pInst )
|
||||
{
|
||||
@@ -1720,7 +1720,7 @@ OUString StarBASIC::GetErrorMsg()
|
||||
}
|
||||
else
|
||||
{
|
||||
return OUString();
|
||||
return EMPTY_OUSTRING;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -40,10 +40,10 @@ SbiStringPool::SbiStringPool( )
|
||||
SbiStringPool::~SbiStringPool()
|
||||
{}
|
||||
|
||||
OUString SbiStringPool::Find( sal_uInt32 n ) const
|
||||
const OUString & SbiStringPool::Find( sal_uInt32 n ) const
|
||||
{
|
||||
if( n == 0 || n > aData.size() )
|
||||
return OUString();
|
||||
return EMPTY_OUSTRING;
|
||||
else
|
||||
return aData[n - 1];
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ public:
|
||||
sal_uInt32 GetSize() const { return aData.size(); }
|
||||
short Add( const OUString& );
|
||||
short Add( double, SbxDataType );
|
||||
OUString Find( sal_uInt32 ) const;
|
||||
const OUString & Find( sal_uInt32 ) const;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -3564,7 +3564,7 @@ void SbRtl_VarType(StarBASIC *, SbxArray & rPar, bool)
|
||||
}
|
||||
|
||||
// Exported function
|
||||
OUString getBasicTypeName( SbxDataType eType )
|
||||
const OUString & getBasicTypeName( SbxDataType eType )
|
||||
{
|
||||
static constexpr OUString pTypeNames[] =
|
||||
{
|
||||
|
@@ -144,17 +144,17 @@ void SbxArray::Put( SbxVariable* pVar, sal_uInt32 nIdx )
|
||||
}
|
||||
}
|
||||
|
||||
OUString SbxArray::GetAlias( sal_uInt32 nIdx )
|
||||
const OUString & SbxArray::GetAlias( sal_uInt32 nIdx )
|
||||
{
|
||||
if( !CanRead() )
|
||||
{
|
||||
SetError( ERRCODE_BASIC_PROP_WRITEONLY );
|
||||
return OUString();
|
||||
return EMPTY_OUSTRING;
|
||||
}
|
||||
SbxVarEntry& rRef = reinterpret_cast<SbxVarEntry&>(GetRef( nIdx ));
|
||||
|
||||
if (!rRef.maAlias)
|
||||
return OUString();
|
||||
return EMPTY_OUSTRING;
|
||||
|
||||
return *rRef.maAlias;
|
||||
}
|
||||
|
@@ -127,7 +127,7 @@ public:
|
||||
StarBASIC* GetLib( std::u16string_view rName ) const;
|
||||
sal_uInt16 GetLibId( std::u16string_view rName ) const;
|
||||
|
||||
OUString GetLibName( sal_uInt16 nLib );
|
||||
const OUString & GetLibName( sal_uInt16 nLib );
|
||||
|
||||
/** announces the library containers which belong to this BasicManager
|
||||
|
||||
|
@@ -28,7 +28,7 @@ class ErrCode;
|
||||
|
||||
// Returns type name for Basic type, array flag is ignored
|
||||
// implementation: basic/source/runtime/methods.cxx
|
||||
BASIC_DLLPUBLIC OUString getBasicTypeName( SbxDataType eType );
|
||||
BASIC_DLLPUBLIC const OUString & getBasicTypeName( SbxDataType eType );
|
||||
|
||||
// Returns type name for Basic objects, especially
|
||||
// important for SbUnoObj instances
|
||||
|
@@ -93,7 +93,7 @@ public:
|
||||
static bool IsRunning();
|
||||
static ErrCode GetErrBasic();
|
||||
// #66536 make additional message accessible by RTL function Error
|
||||
static OUString GetErrorMsg();
|
||||
static const OUString & GetErrorMsg();
|
||||
static sal_Int32 GetErl();
|
||||
|
||||
virtual SbxVariable* Find( const OUString&, SbxClassType ) override;
|
||||
|
@@ -122,7 +122,7 @@ public:
|
||||
void Remove( sal_uInt32 );
|
||||
void Remove( SbxVariable const * );
|
||||
void Merge( SbxArray* );
|
||||
OUString GetAlias(sal_uInt32);
|
||||
const OUString & GetAlias(sal_uInt32);
|
||||
void PutAlias(const OUString&, sal_uInt32);
|
||||
SbxVariable* Find( const OUString&, SbxClassType );
|
||||
};
|
||||
|
Reference in New Issue
Block a user