loplugin:passstuffbyref improved return in basic,framework

Change-Id: Ib19836febb59f4e2bb07dc874cfc6baabc653237
Reviewed-on: https://gerrit.libreoffice.org/47065
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2017-12-26 08:32:51 +02:00
parent 2bf1cc7372
commit 2a421b26c0
13 changed files with 20 additions and 20 deletions

View File

@@ -1448,7 +1448,7 @@ sal_uInt16 StarBASIC::GetCol1() { return GetSbData()->nCol1; }
sal_uInt16 StarBASIC::GetCol2() { return GetSbData()->nCol2; }
// Specific to error handler
ErrCode StarBASIC::GetErrorCode() { return GetSbData()->nCode; }
ErrCode const & StarBASIC::GetErrorCode() { return GetSbData()->nCode; }
const OUString& StarBASIC::GetErrorText() { return GetSbData()->aErrMsg; }
// From 1996-03-29:
@@ -1763,7 +1763,7 @@ bool StarBASIC::ErrorHdl()
return aErrorHdl.Call( this );
}
Link<StarBASIC*,bool> StarBASIC::GetGlobalErrorHdl()
Link<StarBASIC*,bool> const & StarBASIC::GetGlobalErrorHdl()
{
return GetSbData()->aErrHdl;
}

View File

@@ -60,10 +60,10 @@ class SbiStream
public:
SbiStream();
~SbiStream();
ErrCode Open( const OString&, StreamMode, SbiStreamFlags, short );
ErrCode Close();
ErrCode const & Open( const OString&, StreamMode, SbiStreamFlags, short );
ErrCode const & Close();
ErrCode Read(OString&, sal_uInt16 = 0, bool bForceReadingPerByte=false);
ErrCode Read( char& );
ErrCode const & Read( char& );
ErrCode Write( const OString& );
bool IsText() const { return !bool(nMode & SbiStreamFlags::Binary); }

View File

@@ -167,7 +167,7 @@ public:
void Abort(); // with current error code
void Stop();
ErrCode GetErr() { return nErr; }
ErrCode const & GetErr() { return nErr; }
const OUString& GetErrorMsg() { return aErrorMsg; }
sal_Int32 GetErl() { return nErl; }
void EnableReschedule( bool bEnable ) { bReschedule = bEnable; }
@@ -186,7 +186,7 @@ public:
SbiDllMgr* GetDllMgr();
SbiRTLData* GetRTLData() const { return const_cast<SbiRTLData*>(&aRTLData); }
std::shared_ptr<SvNumberFormatter> GetNumberFormatter();
std::shared_ptr<SvNumberFormatter> const & GetNumberFormatter();
sal_uInt32 GetStdDateIdx() const { return nStdDateIdx; }
sal_uInt32 GetStdTimeIdx() const { return nStdTimeIdx; }
sal_uInt32 GetStdDateTimeIdx() const { return nStdDateTimeIdx; }

View File

@@ -445,7 +445,7 @@ void UCBStream::SetSize( sal_uInt64 )
}
ErrCode SbiStream::Open
ErrCode const & SbiStream::Open
( const OString& rName, StreamMode nStrmMode, SbiStreamFlags nFlags, short nL )
{
nMode = nFlags;
@@ -511,7 +511,7 @@ ErrCode SbiStream::Open
return nError;
}
ErrCode SbiStream::Close()
ErrCode const & SbiStream::Close()
{
if( pStrm )
{
@@ -553,7 +553,7 @@ ErrCode SbiStream::Read(OString& rBuf, sal_uInt16 n, bool bForceReadingPerByte)
return nError;
}
ErrCode SbiStream::Read( char& ch )
ErrCode const & SbiStream::Read( char& ch )
{
nExpandOnWriteTo = 0;
if (aLine.isEmpty())

View File

@@ -357,7 +357,7 @@ SbiDllMgr* SbiInstance::GetDllMgr()
}
// #39629 create NumberFormatter with the help of a static method now
std::shared_ptr<SvNumberFormatter> SbiInstance::GetNumberFormatter()
std::shared_ptr<SvNumberFormatter> const & SbiInstance::GetNumberFormatter()
{
LanguageType eLangType = Application::GetSettings().GetLanguageTag().getLanguageType();
SvtSysLocale aSysLocale;

View File

@@ -94,7 +94,7 @@ void SbxBase::SetModified( bool b )
ResetFlag( SbxFlagBits::Modified );
}
ErrCode SbxBase::GetError()
ErrCode const & SbxBase::GetError()
{
return GetSbxData_Impl().eErrCode;
}

View File

@@ -43,7 +43,7 @@ class FWE_DLLPUBLIC ImageWrapper :
return m_aImage;
}
static css::uno::Sequence< sal_Int8 > GetUnoTunnelId();
static css::uno::Sequence< sal_Int8 > const & GetUnoTunnelId();
// XBitmap
virtual css::awt::Size SAL_CALL getSize() override;

View File

@@ -47,7 +47,7 @@ class FWE_DLLPUBLIC XMLNamespaces final
typedef ::std::map< OUString, OUString > NamespaceMap;
/// @throws css::xml::sax::SAXException
OUString getNamespaceValue( const OUString& aNamespace ) const;
OUString const & getNamespaceValue( const OUString& aNamespace ) const;
OUString m_aDefaultNamespace;
OUString m_aXMLAttributeNamespace;

View File

@@ -46,7 +46,7 @@ ImageWrapper::~ImageWrapper()
{
}
Sequence< sal_Int8 > ImageWrapper::GetUnoTunnelId()
Sequence< sal_Int8 > const & ImageWrapper::GetUnoTunnelId()
{
return impl_getStaticIdentifier();
}

View File

@@ -143,7 +143,7 @@ OUString XMLNamespaces::applyNSToElementName( const OUString& aName ) const
return aElementName;
}
OUString XMLNamespaces::getNamespaceValue( const OUString& aNamespace ) const
OUString const & XMLNamespaces::getNamespaceValue( const OUString& aNamespace ) const
{
if ( aNamespace.isEmpty() )
return m_aDefaultNamespace;

View File

@@ -55,7 +55,7 @@ public:
BasicError( const BasicError& rErr );
BasicError( ErrCode nId, BasicErrorReason nR );
ErrCode GetErrorId() const { return nErrorId; }
ErrCode const & GetErrorId() const { return nErrorId; }
};
class ErrorManager;

View File

@@ -130,12 +130,12 @@ public:
// Specific to error handler
static void MakeErrorText( ErrCode, const OUString& aMsg );
static const OUString& GetErrorText();
static ErrCode GetErrorCode();
static ErrCode const & GetErrorCode();
static sal_uInt16 GetVBErrorCode( ErrCode nError );
static ErrCode GetSfxFromVBError( sal_uInt16 nError );
bool IsBreak() const { return bBreak; }
static Link<StarBASIC*,bool> GetGlobalErrorHdl();
static Link<StarBASIC*,bool> const & GetGlobalErrorHdl();
static void SetGlobalErrorHdl( const Link<StarBASIC*,bool>& rNewHdl );
static void SetGlobalBreakHdl( const Link<StarBASIC*,BasicDebugFlags>& rNewHdl );

View File

@@ -81,7 +81,7 @@ public:
bool Store( SvStream& );
virtual bool LoadCompleted();
static ErrCode GetError();
static ErrCode const & GetError();
static void SetError( ErrCode );
static bool IsError();
static void ResetError();