[Libreoffice-commits] core.git: basic/source framework/inc framework/source include/basic

Noel Grandin noel.grandin at collabora.co.uk
Tue Dec 26 18:56:27 UTC 2017


 basic/source/classes/sb.cxx                   |    4 ++--
 basic/source/inc/iosys.hxx                    |    6 +++---
 basic/source/inc/runtime.hxx                  |    4 ++--
 basic/source/runtime/iosys.cxx                |    6 +++---
 basic/source/runtime/runtime.cxx              |    2 +-
 basic/source/sbx/sbxbase.cxx                  |    2 +-
 framework/inc/classes/imagewrapper.hxx        |    2 +-
 framework/inc/xml/xmlnamespaces.hxx           |    2 +-
 framework/source/fwe/classes/imagewrapper.cxx |    2 +-
 framework/source/fwe/xml/xmlnamespaces.cxx    |    2 +-
 include/basic/basmgr.hxx                      |    2 +-
 include/basic/sbstar.hxx                      |    4 ++--
 include/basic/sbxcore.hxx                     |    2 +-
 13 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit 2a421b26c0100b35d28b86a5d79afa15af9580dd
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Dec 26 08:32:51 2017 +0200

    loplugin:passstuffbyref improved return in basic,framework
    
    Change-Id: Ib19836febb59f4e2bb07dc874cfc6baabc653237
    Reviewed-on: https://gerrit.libreoffice.org/47065
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 294f7ee5744c..1be75c333424 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -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;
 }
diff --git a/basic/source/inc/iosys.hxx b/basic/source/inc/iosys.hxx
index 7d7e9e832633..9e1b4fe80778 100644
--- a/basic/source/inc/iosys.hxx
+++ b/basic/source/inc/iosys.hxx
@@ -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); }
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index 86baec31ac53..d566276922dc 100644
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -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; }
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index 34ad8c28936b..49932c9e8316 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -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())
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 2b81778917e0..e4353dba40c5 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -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;
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index 616d6edf556e..1b5a6b8eb228 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -94,7 +94,7 @@ void SbxBase::SetModified( bool b )
         ResetFlag( SbxFlagBits::Modified );
 }
 
-ErrCode SbxBase::GetError()
+ErrCode const & SbxBase::GetError()
 {
     return GetSbxData_Impl().eErrCode;
 }
diff --git a/framework/inc/classes/imagewrapper.hxx b/framework/inc/classes/imagewrapper.hxx
index 2c759f5afa64..14b93c1e1e3c 100644
--- a/framework/inc/classes/imagewrapper.hxx
+++ b/framework/inc/classes/imagewrapper.hxx
@@ -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;
diff --git a/framework/inc/xml/xmlnamespaces.hxx b/framework/inc/xml/xmlnamespaces.hxx
index 101c3f4e1d34..f8e1369bad8a 100644
--- a/framework/inc/xml/xmlnamespaces.hxx
+++ b/framework/inc/xml/xmlnamespaces.hxx
@@ -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;
diff --git a/framework/source/fwe/classes/imagewrapper.cxx b/framework/source/fwe/classes/imagewrapper.cxx
index 1d72f61bb0c2..f916d7a4e607 100644
--- a/framework/source/fwe/classes/imagewrapper.cxx
+++ b/framework/source/fwe/classes/imagewrapper.cxx
@@ -46,7 +46,7 @@ ImageWrapper::~ImageWrapper()
 {
 }
 
-Sequence< sal_Int8 > ImageWrapper::GetUnoTunnelId()
+Sequence< sal_Int8 > const & ImageWrapper::GetUnoTunnelId()
 {
     return impl_getStaticIdentifier();
 }
diff --git a/framework/source/fwe/xml/xmlnamespaces.cxx b/framework/source/fwe/xml/xmlnamespaces.cxx
index 4b930ad33f20..94a97eaa1f03 100644
--- a/framework/source/fwe/xml/xmlnamespaces.cxx
+++ b/framework/source/fwe/xml/xmlnamespaces.cxx
@@ -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;
diff --git a/include/basic/basmgr.hxx b/include/basic/basmgr.hxx
index 5450228d4493..5e70e6ea138b 100644
--- a/include/basic/basmgr.hxx
+++ b/include/basic/basmgr.hxx
@@ -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;
diff --git a/include/basic/sbstar.hxx b/include/basic/sbstar.hxx
index 071025d52fa3..8774f524c6c0 100644
--- a/include/basic/sbstar.hxx
+++ b/include/basic/sbstar.hxx
@@ -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 );
diff --git a/include/basic/sbxcore.hxx b/include/basic/sbxcore.hxx
index 3be787bf0d7f..e0d90d367885 100644
--- a/include/basic/sbxcore.hxx
+++ b/include/basic/sbxcore.hxx
@@ -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();


More information about the Libreoffice-commits mailing list