connectivity/source/drivers/ado/AConnection.cxx  |    3 +--
 connectivity/source/drivers/ado/ADriver.cxx      |    1 -
 connectivity/source/inc/ado/AConnection.hxx      |   13 +++++--------
 ucb/source/cacher/contentresultsetwrapper.cxx    |    2 +-
 ucb/source/cacher/contentresultsetwrapper.hxx    |    2 +-
 ucb/source/core/ucbstore.cxx                     |    2 +-
 ucb/source/core/ucbstore.hxx                     |    2 +-
 ucb/source/ucp/file/filinsreq.hxx                |    4 ++--
 ucb/source/ucp/webdav-curl/CurlSession.cxx       |    4 ++--
 xmlhelp/source/cxxhelp/provider/databases.cxx    |    2 +-
 xmlhelp/source/cxxhelp/provider/databases.hxx    |    2 +-
 xmlhelp/source/cxxhelp/provider/urlparameter.cxx |   12 ++++++------
 xmlhelp/source/cxxhelp/provider/urlparameter.hxx |    8 ++++----
 xmlsecurity/inc/documentsignaturemanager.hxx     |    5 ++++-
 xmlsecurity/source/helper/xsecctl.cxx            |    2 +-
 15 files changed, 31 insertions(+), 33 deletions(-)

New commits:
commit e1ecd89204925c80454a9f9f33a02430f33cb498
Author:     Noel Grandin <[email protected]>
AuthorDate: Thu Nov 7 11:54:09 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Thu Nov 7 14:31:24 2024 +0100

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

diff --git a/ucb/source/cacher/contentresultsetwrapper.cxx 
b/ucb/source/cacher/contentresultsetwrapper.cxx
index a5161f0497e9..1766bc601b05 100644
--- a/ucb/source/cacher/contentresultsetwrapper.cxx
+++ b/ucb/source/cacher/contentresultsetwrapper.cxx
@@ -362,7 +362,7 @@ Reference< XPropertySetInfo > SAL_CALL 
ContentResultSetWrapper::getPropertySetIn
 }
 
 // virtual
-Reference< XPropertySetInfo > 
ContentResultSetWrapper::getPropertySetInfoImpl(std::unique_lock<std::mutex>& 
rGuard)
+const Reference< XPropertySetInfo > & 
ContentResultSetWrapper::getPropertySetInfoImpl(std::unique_lock<std::mutex>& 
rGuard)
 {
     impl_EnsureNotDisposed(rGuard);
     if( m_xPropertySetInfo.is() )
diff --git a/ucb/source/cacher/contentresultsetwrapper.hxx 
b/ucb/source/cacher/contentresultsetwrapper.hxx
index c36dc6131785..edbdd7569608 100644
--- a/ucb/source/cacher/contentresultsetwrapper.hxx
+++ b/ucb/source/cacher/contentresultsetwrapper.hxx
@@ -173,7 +173,7 @@ public:
 
     virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
     getPropertySetInfo() override final;
-    css::uno::Reference< css::beans::XPropertySetInfo >
+    const css::uno::Reference< css::beans::XPropertySetInfo > &
     getPropertySetInfoImpl(std::unique_lock<std::mutex>& rGuard);
 
     virtual void SAL_CALL
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 6cc7ee759ab8..fd5da4202ab5 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -818,7 +818,7 @@ void PropertySetRegistry::renamePropertySet( const 
OUString& rOldKey,
 }
 
 
-Reference< XMultiServiceFactory > 
PropertySetRegistry::getConfigProvider(std::unique_lock<std::mutex>& /*rGuard*/)
+const Reference< XMultiServiceFactory > & 
PropertySetRegistry::getConfigProvider(std::unique_lock<std::mutex>& /*rGuard*/)
 {
     if ( !m_xConfigProvider.is() )
     {
diff --git a/ucb/source/core/ucbstore.hxx b/ucb/source/core/ucbstore.hxx
index 791abdf33dec..5422f8ce2b16 100644
--- a/ucb/source/core/ucbstore.hxx
+++ b/ucb/source/core/ucbstore.hxx
@@ -93,7 +93,7 @@ class PropertySetRegistry : public cppu::WeakImplHelper <
     bool                              m_bTriedToGetRootWriteAccess;
 
 private:
-    css::uno::Reference< css::lang::XMultiServiceFactory >
+    const css::uno::Reference< css::lang::XMultiServiceFactory > &
     getConfigProvider(std::unique_lock<std::mutex>& l);
 
     void add   ( std::unique_lock<std::mutex>& rCreatorGuard, 
PersistentPropertySet* pSet );
diff --git a/ucb/source/ucp/file/filinsreq.hxx 
b/ucb/source/ucp/file/filinsreq.hxx
index 7f2e59a4c98a..52bfbcb885a6 100644
--- a/ucb/source/ucp/file/filinsreq.hxx
+++ b/ucb/source/ucp/file/filinsreq.hxx
@@ -113,12 +113,12 @@ class XInteractionSupplyNameImpl : public 
cppu::WeakImplHelper<
             return p2->isSelected();
         }
 
-        OUString newName() const
+        const OUString & newName() const
         {
             if( p1->isSelected() )
                 return p1->getName();
             else
-                return OUString();
+                return EMPTY_OUSTRING;
         }
 
         css::uno::Reference<css::task::XInteractionRequest> const& 
getRequest() const
diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index e98008487fec..fc88f9d46c84 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -1252,10 +1252,10 @@ auto CurlProcessor::ProcessRequest(
         OUString UserName;
         OUString PassWord;
         decltype(CURLAUTH_ANY) AuthMask; ///< allowed auth methods
-        Auth(OUString aUserName, OUString aPassword, decltype(CURLAUTH_ANY) 
const & rAuthMask)
+        Auth(OUString aUserName, OUString aPassword, decltype(CURLAUTH_ANY) 
aAuthMask)
             : UserName(std::move(aUserName))
             , PassWord(std::move(aPassword))
-            , AuthMask(rAuthMask)
+            , AuthMask(aAuthMask)
         {
         }
     };
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx 
b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 6119d8373f92..d1662f72da4a 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -262,7 +262,7 @@ OUString Databases::getInstallPathAsURL()
     return m_aInstallDirectory;
 }
 
-OUString Databases::getInstallPathAsURL(std::unique_lock<std::mutex>& )
+const OUString & Databases::getInstallPathAsURL(std::unique_lock<std::mutex>& )
 {
     return m_aInstallDirectory;
 }
diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx 
b/xmlhelp/source/cxxhelp/provider/databases.hxx
index c80e2e2dfad6..c7c81845cbe0 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.hxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.hxx
@@ -146,7 +146,7 @@ namespace chelp {
         static OString getImageTheme();
 
         OUString getInstallPathAsURL();
-        OUString getInstallPathAsURL(std::unique_lock<std::mutex>& rGuard);
+        const OUString & getInstallPathAsURL(std::unique_lock<std::mutex>& 
rGuard);
 
         const std::vector< OUString >& getModuleList( const OUString& Language 
);
 
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx 
b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index f10a4ad2fff6..bdbce90d2175 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -120,7 +120,7 @@ OUString const & URLParameter::get_id()
     return m_aId;
 }
 
-OUString URLParameter::get_tag()
+const OUString & URLParameter::get_tag()
 {
     if( isFile() )
         return get_the_tag();
@@ -129,7 +129,7 @@ OUString URLParameter::get_tag()
 }
 
 
-OUString URLParameter::get_title()
+const OUString & URLParameter::get_title()
 {
     if( isFile() )
         return get_the_title();
@@ -176,7 +176,7 @@ void URLParameter::init()
 }
 
 
-OUString URLParameter::get_the_tag()
+const OUString & URLParameter::get_the_tag()
 {
     if(m_bUseDB) {
         if( ! m_bHelpDataFileRead )
@@ -187,7 +187,7 @@ OUString URLParameter::get_the_tag()
         return m_aTag;
     }
     else
-        return OUString();
+        return EMPTY_OUSTRING;
 }
 
 
@@ -205,7 +205,7 @@ OUString const & URLParameter::get_path()
 }
 
 
-OUString URLParameter::get_the_title()
+const OUString & URLParameter::get_the_title()
 {
     if(m_bUseDB) {
         if( ! m_bHelpDataFileRead )
@@ -215,7 +215,7 @@ OUString URLParameter::get_the_title()
         return m_aTitle;
     }
     else
-        return OUString();
+        return EMPTY_OUSTRING;
 }
 
 
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.hxx 
b/xmlhelp/source/cxxhelp/provider/urlparameter.hxx
index 3c6d02430b3b..0b99f9025304 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.hxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.hxx
@@ -118,7 +118,7 @@ namespace chelp {
 
         OUString const & get_id();
 
-        OUString get_tag();
+        const OUString & get_tag();
 
         //  Not called for a directory
 
@@ -126,7 +126,7 @@ namespace chelp {
 
         const OUString& get_eid() const   { return m_aEid; }
 
-        OUString get_title();
+        const OUString & get_title();
 
         OUString get_jar();
 
@@ -198,9 +198,9 @@ namespace chelp {
 
         void init();
 
-        OUString get_the_tag();
+        const OUString & get_the_tag();
 
-        OUString get_the_title();
+        const OUString & get_the_title();
 
         void readHelpDataFile();
 
diff --git a/xmlsecurity/inc/documentsignaturemanager.hxx 
b/xmlsecurity/inc/documentsignaturemanager.hxx
index a66d97e3c7dd..56597106f9c1 100644
--- a/xmlsecurity/inc/documentsignaturemanager.hxx
+++ b/xmlsecurity/inc/documentsignaturemanager.hxx
@@ -127,7 +127,10 @@ public:
     {
         mxSignatureStream = xSignatureStream;
     }
-    css::uno::Reference<css::io::XStream> getSignatureStream() const { return 
mxSignatureStream; }
+    const css::uno::Reference<css::io::XStream>& getSignatureStream() const
+    {
+        return mxSignatureStream;
+    }
     void setScriptingSignatureStream(
         const css::uno::Reference<css::io::XStream>& xScriptingSignatureStream)
     {
diff --git a/xmlsecurity/source/helper/xsecctl.cxx 
b/xmlsecurity/source/helper/xsecctl.cxx
index fd68c3486d76..d83f0726ca51 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -46,7 +46,7 @@ using namespace com::sun::star;
 
 namespace
 {
-OUString getDigestURI(sal_Int32 nID)
+const OUString & getDigestURI(sal_Int32 nID)
 {
     switch( nID )
     {
commit 6d6d11a2d26dfc5f4320bd7523ebbe61759eda8c
Author:     Noel Grandin <[email protected]>
AuthorDate: Thu Nov 7 12:12:47 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Thu Nov 7 14:31:13 2024 +0100

    use more concrete UNO type in connectivity::ado
    
    Change-Id: I4a23e8847496166f1f9668830b97c71a248dd143
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176206
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/connectivity/source/drivers/ado/AConnection.cxx 
b/connectivity/source/drivers/ado/AConnection.cxx
index 600604e5eafb..8fe1f3920c1e 100644
--- a/connectivity/source/drivers/ado/AConnection.cxx
+++ b/connectivity/source/drivers/ado/AConnection.cxx
@@ -54,7 +54,6 @@ 
IMPLEMENT_SERVICE_INFO(OConnection,"com.sun.star.sdbcx.AConnection","com.sun.sta
 OConnection::OConnection(ODriver*   _pDriver)
                          : m_xCatalog(nullptr),
                          m_pDriver(_pDriver),
-                         m_pCatalog(nullptr),
                          m_nEngineType(0),
                          m_bClosed(false),
                          m_bAutocommit(true)
@@ -456,7 +455,7 @@ void OConnection::disposing()
 
     m_bClosed   = true;
     m_xMetaData = css::uno::WeakReference< css::sdbc::XDatabaseMetaData>();
-    m_xCatalog  = css::uno::WeakReference< css::sdbcx::XTablesSupplier>();
+    m_xCatalog.clear();
     m_pDriver   = nullptr;
 
     m_aAdoConnection.Close();
diff --git a/connectivity/source/drivers/ado/ADriver.cxx 
b/connectivity/source/drivers/ado/ADriver.cxx
index 6568f7a1ee84..69b4aa79d1e3 100644
--- a/connectivity/source/drivers/ado/ADriver.cxx
+++ b/connectivity/source/drivers/ado/ADriver.cxx
@@ -190,7 +190,6 @@ Reference< XTablesSupplier > SAL_CALL 
ODriver::getDataDefinitionByConnection( co
             aCatalog.putref_ActiveConnection(pConnection->getConnection());
             rtl::Reference<OCatalog> pCatalog = new 
OCatalog(aCatalog,pConnection);
             xTab = pCatalog;
-            pConnection->setCatalog(xTab);
             pConnection->setCatalog(pCatalog.get());
         }
     }
diff --git a/connectivity/source/inc/ado/AConnection.hxx 
b/connectivity/source/inc/ado/AConnection.hxx
index c2c82100363d..38a8a6d757bb 100644
--- a/connectivity/source/inc/ado/AConnection.hxx
+++ b/connectivity/source/inc/ado/AConnection.hxx
@@ -24,9 +24,11 @@
 #include <map>
 #include <string_view>
 #include <connectivity/CommonTools.hxx>
+#include <unotools/weakref.hxx>
 #include <OTypeInfo.hxx>
 #include <TConnection.hxx>
 #include <ado/Awrapado.hxx>
+#include <ado/ACatalog.hxx>
 
 namespace connectivity::ado
 {
@@ -40,7 +42,6 @@ namespace connectivity::ado
 
         class WpADOConnection;
         class ODriver;
-        class OCatalog;
         typedef std::multimap<DataTypeEnum, OExtendedTypeInfo*>       
OTypeInfoMap;
         typedef connectivity::OMetaConnection                           
OConnection_BASE;
 
@@ -54,11 +55,10 @@ namespace connectivity::ado
             OTypeInfoMap                m_aTypeInfo;    //  vector containing 
an entry
                                                                                
 //  for each row returned by
                                                                                
 //  DatabaseMetaData.getTypeInfo.
-            css::uno::WeakReference< css::sdbcx::XTablesSupplier>      
m_xCatalog;
+            unotools::WeakReference<OCatalog>      m_xCatalog;
             ODriver*                    m_pDriver;
         private:
             WpADOConnection             m_aAdoConnection;
-            OCatalog*                   m_pCatalog;
             sal_Int32                   m_nEngineType;
             bool                        m_bClosed;
             bool                        m_bAutocommit;
@@ -108,15 +108,12 @@ namespace connectivity::ado
             virtual void SAL_CALL clearWarnings(  ) override;
 
             WpADOConnection& getConnection() { return m_aAdoConnection; }
-            void setCatalog(const css::uno::WeakReference< 
css::sdbcx::XTablesSupplier>& _xCat) { m_xCatalog = _xCat; }
-            void setCatalog(OCatalog* _pCatalog) { m_pCatalog = _pCatalog; }
+            void setCatalog(OCatalog* _pCatalog) { m_xCatalog = _pCatalog; }
 
             const OTypeInfoMap* getTypeInfo() const { return &m_aTypeInfo;}
             OCatalog* getAdoCatalog() const
             {
-                if ( m_xCatalog.get().is() )
-                    return m_pCatalog;
-                return nullptr;
+                return m_xCatalog.get().get();
             }
 
             sal_Int32 getEngineType()   const { return m_nEngineType; }

Reply via email to