summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-12-19 09:34:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-12-19 09:52:03 +0100
commitf9de7c851ed0326177f3f77af855bfc13b62cecd (patch)
tree5e7c70f62d5b6afbd1b5bc9a523649b1a61791f2 /framework
parentec928ac5d84273b4bc1f923c545834dc59d3e394 (diff)
HandlerCFGAccess::read should take references
Change-Id: Icecb26e15d97fcf9c6694053fafc99b62385ffb5 Reviewed-on: https://gerrit.libreoffice.org/65395 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/classes/protocolhandlercache.hxx3
-rw-r--r--framework/source/fwi/classes/protocolhandlercache.cxx17
2 files changed, 9 insertions, 11 deletions
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));
}