include/svl/filenotation.hxx                       |    2 +-
 include/svl/macitem.hxx                            |    2 +-
 include/svl/sharecontrolfile.hxx                   |    2 +-
 svl/source/items/macitem.cxx                       |    2 +-
 svl/source/misc/filenotation.cxx                   |    4 ++--
 svl/source/misc/sharecontrolfile.cxx               |    2 +-
 svl/source/passwordcontainer/passwordcontainer.hxx |    8 ++++----
 svl/source/passwordcontainer/syscreds.cxx          |    2 +-
 svl/source/passwordcontainer/syscreds.hxx          |    2 +-
 9 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 52357eefa7abdf4f648e311ce6ce9fd25b14f65e
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Nov 5 13:47:18 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Wed Nov 6 09:25:46 2024 +0100

    loplugin:passstuffbyref in svl
    
    Change-Id: Ibc4628941b40159aa35a0a55900efb3dd882369e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176056
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/include/svl/filenotation.hxx b/include/svl/filenotation.hxx
index b66c2d56f394..d61a2ae06f0e 100644
--- a/include/svl/filenotation.hxx
+++ b/include/svl/filenotation.hxx
@@ -41,7 +41,7 @@ namespace svt
         OFileNotation( const OUString& _rUrlOrPath );
         OFileNotation( const OUString& _rUrlOrPath, NOTATION _eInputNotation );
 
-        OUString get(NOTATION _eOutputNotation) const;
+        const OUString & get(NOTATION _eOutputNotation) const;
 
     private:
         SVL_DLLPRIVATE void construct( const OUString& _rUrlOrPath );
diff --git a/include/svl/macitem.hxx b/include/svl/macitem.hxx
index 412f5cec8ece..999acb8a9f02 100644
--- a/include/svl/macitem.hxx
+++ b/include/svl/macitem.hxx
@@ -56,7 +56,7 @@ public:
 
     const OUString &GetLibName() const        { return aLibName; }
     const OUString &GetMacName() const        { return aMacName; }
-    OUString GetLanguage()const;
+    const OUString &GetLanguage()const;
 
     ScriptType GetScriptType() const        { return eType; }
 
diff --git a/include/svl/sharecontrolfile.hxx b/include/svl/sharecontrolfile.hxx
index a7b9ac1db297..e9aff0f2429e 100644
--- a/include/svl/sharecontrolfile.hxx
+++ b/include/svl/sharecontrolfile.hxx
@@ -64,7 +64,7 @@ public:
     void RemoveFile();
 private:
     void RemoveFileImpl(std::unique_lock<std::mutex>& rGuard);
-    std::vector< LockFileEntry > 
GetUsersDataImpl(std::unique_lock<std::mutex>& rGuard);
+    const std::vector< LockFileEntry > & 
GetUsersDataImpl(std::unique_lock<std::mutex>& rGuard);
 };
 
 }
diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx
index 0b242c7cffa8..bd3dfccffcb8 100644
--- a/svl/source/items/macitem.cxx
+++ b/svl/source/items/macitem.cxx
@@ -39,7 +39,7 @@ SvxMacro::SvxMacro( OUString _aMacName, const OUString 
&rLanguage)
         eType=JAVASCRIPT;
 }
 
-OUString SvxMacro::GetLanguage()const
+const OUString & SvxMacro::GetLanguage()const
 {
     if(eType==STARBASIC)
     {
diff --git a/svl/source/misc/filenotation.cxx b/svl/source/misc/filenotation.cxx
index c4337708bc8b..f1ef595570ea 100644
--- a/svl/source/misc/filenotation.cxx
+++ b/svl/source/misc/filenotation.cxx
@@ -105,7 +105,7 @@ namespace svt
         OSL_ENSURE( bSuccess, "OFileNotation::OFileNotation: could not detect 
the format!" );
     }
 
-    OUString OFileNotation::get(NOTATION _eOutputNotation) const
+    const OUString & OFileNotation::get(NOTATION _eOutputNotation) const
     {
         switch (_eOutputNotation)
         {
@@ -114,7 +114,7 @@ namespace svt
         }
 
         OSL_FAIL("OFileNotation::get: invalid enum value!");
-        return OUString();
+        return EMPTY_OUSTRING;
     }
 
 }   // namespace svt
diff --git a/svl/source/misc/sharecontrolfile.cxx 
b/svl/source/misc/sharecontrolfile.cxx
index 10c6e8b24944..92b8d04445dd 100644
--- a/svl/source/misc/sharecontrolfile.cxx
+++ b/svl/source/misc/sharecontrolfile.cxx
@@ -142,7 +142,7 @@ std::vector< o3tl::enumarray< LockFileComponent, OUString > 
> ShareControlFile::
     return GetUsersDataImpl(aGuard);
 }
 
-std::vector< o3tl::enumarray< LockFileComponent, OUString > > 
ShareControlFile::GetUsersDataImpl(std::unique_lock<std::mutex>& /*rGuard*/)
+const std::vector< o3tl::enumarray< LockFileComponent, OUString > > & 
ShareControlFile::GetUsersDataImpl(std::unique_lock<std::mutex>& /*rGuard*/)
 {
     if ( !IsValid() )
         throw io::NotConnectedException();
diff --git a/svl/source/passwordcontainer/passwordcontainer.hxx 
b/svl/source/passwordcontainer/passwordcontainer.hxx
index 4a0b4f1e46d4..11f8ab7485bb 100644
--- a/svl/source/passwordcontainer/passwordcontainer.hxx
+++ b/svl/source/passwordcontainer/passwordcontainer.hxx
@@ -138,20 +138,20 @@ public:
         return ::std::vector< OUString >();
     }
 
-    OUString GetPersistentPasswords() const
+    const OUString & GetPersistentPasswords() const
     {
         if ( m_bHasPersistentPassword )
             return m_aPersistentPassword;
 
-        return OUString();
+        return EMPTY_OUSTRING;
     }
 
-    OUString GetPersistentIV() const
+    const OUString & GetPersistentIV() const
     {
         if ( m_bHasPersistentPassword )
             return m_aPersistentIV;
 
-        return OUString();
+        return EMPTY_OUSTRING;
     }
 
     void SetMemoryPasswords( ::std::vector< OUString >&& aMemList )
diff --git a/svl/source/passwordcontainer/syscreds.cxx 
b/svl/source/passwordcontainer/syscreds.cxx
index 9f2aa2198286..99bb0b1b0852 100644
--- a/svl/source/passwordcontainer/syscreds.cxx
+++ b/svl/source/passwordcontainer/syscreds.cxx
@@ -58,7 +58,7 @@ SysCredentialsConfigItem::getSystemCredentialsURLs()
     return getSystemCredentialsURLs(aGuard);
 }
 
-uno::Sequence< OUString >
+const uno::Sequence< OUString > &
 
SysCredentialsConfigItem::getSystemCredentialsURLs(std::unique_lock<std::mutex>&
 /*rGuard*/)
 {
     if ( !m_bInited )
diff --git a/svl/source/passwordcontainer/syscreds.hxx 
b/svl/source/passwordcontainer/syscreds.hxx
index 75241c4e79dd..00c1cf527e56 100644
--- a/svl/source/passwordcontainer/syscreds.hxx
+++ b/svl/source/passwordcontainer/syscreds.hxx
@@ -44,7 +44,7 @@ class SysCredentialsConfigItem : public utl::ConfigItem
         //bool isSystemCredentialsURL( const OUString & rURL ) const;
 
     private:
-        css::uno::Sequence< OUString > 
getSystemCredentialsURLs(std::unique_lock<std::mutex>& rGuard);
+        const css::uno::Sequence< OUString > & 
getSystemCredentialsURLs(std::unique_lock<std::mutex>& rGuard);
         virtual void ImplCommit() override;
 
         std::mutex m_aMutex;

Reply via email to