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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 19 08:52:27 UTC 2018


 framework/inc/classes/protocolhandlercache.hxx        |    3 +--
 framework/source/fwi/classes/protocolhandlercache.cxx |   17 ++++++++---------
 2 files changed, 9 insertions(+), 11 deletions(-)

New commits:
commit f9de7c851ed0326177f3f77af855bfc13b62cecd
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Dec 19 09:34:36 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Dec 19 09:52:03 2018 +0100

    HandlerCFGAccess::read should take references
    
    Change-Id: Icecb26e15d97fcf9c6694053fafc99b62385ffb5
    Reviewed-on: https://gerrit.libreoffice.org/65395
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/framework/inc/classes/protocolhandlercache.hxx b/framework/inc/classes/protocolhandlercache.hxx
index 6c3d7c677ad7..7f5af88f342e 100644
--- a/framework/inc/classes/protocolhandlercache.hxx
+++ b/framework/inc/classes/protocolhandlercache.hxx
@@ -137,8 +137,7 @@ class FWI_DLLPUBLIC HandlerCFGAccess : public ::utl::ConfigItem
     /* interface */
     public:
                  HandlerCFGAccess( const OUString& sPackage  );
-        void     read            (       std::unique_ptr<HandlerHash>& ppHandler ,
-                                         std::unique_ptr<PatternHash>& ppPattern );
+        void     read            ( HandlerHash& rHandlerHash, PatternHash& rPatternHash );
 
         void setCache(HandlerCache* pCache) {m_pCache = pCache;};
         virtual void Notify(const css::uno::Sequence< OUString >& lPropertyNames) override;
diff --git a/framework/source/fwi/classes/protocolhandlercache.cxx b/framework/source/fwi/classes/protocolhandlercache.cxx
index 6070d5c2407c..41a8d5005602 100644
--- a/framework/source/fwi/classes/protocolhandlercache.cxx
+++ b/framework/source/fwi/classes/protocolhandlercache.cxx
@@ -94,7 +94,7 @@ HandlerCache::HandlerCache()
         m_pHandler.reset(new HandlerHash);
         m_pPattern.reset(new PatternHash);
         m_pConfig.reset(new HandlerCFGAccess(PACKAGENAME_PROTOCOLHANDLER));
-        m_pConfig->read(m_pHandler,m_pPattern);
+        m_pConfig->read(*m_pHandler, *m_pPattern);
         m_pConfig->setCache(this);
     }
 
@@ -183,14 +183,13 @@ HandlerCFGAccess::HandlerCFGAccess( const OUString& sPackage )
     @descr      User use us as a wrapper between configuration api and his internal structures.
                 He give us some pointer to his member and we fill it.
 
-    @param      pHandler
-                pointer to a list of protocol handler infos
+    @param      rHandlerHash
+                list of protocol handler infos
 
-    @param      pPattern
+    @param      rPatternHash
                 reverse map of handler pattern to her uno names
  */
-void HandlerCFGAccess::read( std::unique_ptr<HandlerHash>& ppHandler ,
-                             std::unique_ptr<PatternHash>& ppPattern )
+void HandlerCFGAccess::read( HandlerHash& rHandlerHash, PatternHash& rPatternHash )
 {
     // list of all uno implementation names without encoding
     css::uno::Sequence< OUString > lNames = GetNodeNames( SETNAME_HANDLER, ::utl::ConfigNameFormat::LocalPath );
@@ -234,11 +233,11 @@ void HandlerCFGAccess::read( std::unique_ptr<HandlerHash>& ppHandler ,
         // register his pattern into the performance search hash
         for (auto const& item : aHandler.m_lProtocols)
         {
-            (*ppPattern)[item] = lNames[nSource];
+            rPatternHash[item] = lNames[nSource];
         }
 
         // insert the handler info into the normal handler cache
-        (*ppHandler)[lNames[nSource]] = aHandler;
+        rHandlerHash[lNames[nSource]] = aHandler;
         ++nSource;
     }
 }
@@ -248,7 +247,7 @@ void HandlerCFGAccess::Notify(const css::uno::Sequence< OUString >& /*lPropertyN
     std::unique_ptr<HandlerHash> pHandler(new HandlerHash);
     std::unique_ptr<PatternHash> pPattern(new PatternHash);
 
-    read(pHandler, pPattern);
+    read(*pHandler, *pPattern);
     if (m_pCache)
         m_pCache->takeOver(std::move(pHandler), std::move(pPattern));
 }


More information about the Libreoffice-commits mailing list