diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-28 09:49:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-28 10:42:37 +0200 |
commit | 44a11bb8c99e02ac3ac16b405377ea61ffa8841b (patch) | |
tree | fb7bac949b877c90518a35bd0278ef3dd51a2779 /xmlhelp | |
parent | 7091a5416e6e1d5ff8c3b40646de30fe1458db24 (diff) |
clang-tidy modernize-pass-by-value in xml*
Change-Id: I9bd5f6adfd138c391d76aebfe08ba01e6b3ab3bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137550
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/source/cxxhelp/inc/tvfactory.hxx | 2 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/inc/tvread.hxx | 2 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/content.cxx | 25 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.cxx | 17 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.hxx | 21 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/db.hxx | 10 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/resultsetbase.cxx | 9 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/resultsetbase.hxx | 4 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx | 5 | ||||
-rw-r--r-- | xmlhelp/source/treeview/tvfactory.cxx | 5 | ||||
-rw-r--r-- | xmlhelp/source/treeview/tvread.cxx | 5 |
11 files changed, 56 insertions, 49 deletions
diff --git a/xmlhelp/source/cxxhelp/inc/tvfactory.hxx b/xmlhelp/source/cxxhelp/inc/tvfactory.hxx index b5a557842867..8b51c2960324 100644 --- a/xmlhelp/source/cxxhelp/inc/tvfactory.hxx +++ b/xmlhelp/source/cxxhelp/inc/tvfactory.hxx @@ -36,7 +36,7 @@ class TVFactory final : public cppu::WeakImplHelper < { public: - TVFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext ); + TVFactory( css::uno::Reference< css::uno::XComponentContext > xContext ); virtual ~TVFactory() override; diff --git a/xmlhelp/source/cxxhelp/inc/tvread.hxx b/xmlhelp/source/cxxhelp/inc/tvread.hxx index fad7fa42fcdd..08bfdb6482da 100644 --- a/xmlhelp/source/cxxhelp/inc/tvread.hxx +++ b/xmlhelp/source/cxxhelp/inc/tvread.hxx @@ -241,7 +241,7 @@ namespace treeview { class TreeFileIterator { public: - TreeFileIterator( const OUString& aLanguage ); + TreeFileIterator( OUString aLanguage ); OUString nextTreeFile( sal_Int32& rnFileSize ); private: diff --git a/xmlhelp/source/cxxhelp/provider/content.cxx b/xmlhelp/source/cxxhelp/provider/content.cxx index 001d7ea76eb9..449c86da2df5 100644 --- a/xmlhelp/source/cxxhelp/provider/content.cxx +++ b/xmlhelp/source/cxxhelp/provider/content.cxx @@ -35,6 +35,7 @@ #include <ucbhelper/propertyvalueset.hxx> #include <ucbhelper/cancelcommandexecution.hxx> #include <ucbhelper/macros.hxx> +#include <utility> #include "content.hxx" #include "provider.hxx" #include "resultset.hxx" @@ -139,15 +140,15 @@ private: public: ResultSetForRootFactory( - const uno::Reference< uno::XComponentContext >& xContext, - const uno::Reference< ucb::XContentProvider >& xProvider, + uno::Reference< uno::XComponentContext > xContext, + uno::Reference< ucb::XContentProvider > xProvider, const uno::Sequence< beans::Property >& seq, - const URLParameter& rURLParameter, + URLParameter aURLParameter, Databases* pDatabases ) - : m_xContext( xContext ), - m_xProvider( xProvider ), + : m_xContext(std::move( xContext )), + m_xProvider(std::move( xProvider )), m_seq( seq ), - m_aURLParameter( rURLParameter ), + m_aURLParameter(std::move( aURLParameter )), m_pDatabases( pDatabases ) { } @@ -176,15 +177,15 @@ private: public: ResultSetForQueryFactory( - const uno::Reference< uno::XComponentContext >& rxContext, - const uno::Reference< ucb::XContentProvider >& xProvider, + uno::Reference< uno::XComponentContext > xContext, + uno::Reference< ucb::XContentProvider > xProvider, const uno::Sequence< beans::Property >& seq, - const URLParameter& rURLParameter, + URLParameter aURLParameter, Databases* pDatabases ) - : m_xContext( rxContext ), - m_xProvider( xProvider ), + : m_xContext(std::move( xContext )), + m_xProvider(std::move( xProvider )), m_seq( seq ), - m_aURLParameter( rURLParameter ), + m_aURLParameter(std::move( aURLParameter )), m_pDatabases( pDatabases ) { } diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 7d70fde659ce..48659524de0e 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -57,6 +57,7 @@ #include <comphelper/propertyvalue.hxx> #include <comphelper/storagehelper.hxx> +#include <utility> #include "databases.hxx" #include "urlparameter.hxx" @@ -566,9 +567,9 @@ namespace chelp { KeywordInfo::KeywordElement::KeywordElement( Databases const *pDatabases, helpdatafileproxy::Hdf* pHdf, - OUString const & ky, + OUString ky, std::u16string_view data ) - : key( ky ) + : key(std::move( ky )) { pDatabases->replaceName( key ); init( pDatabases,pHdf,data ); @@ -1100,24 +1101,24 @@ void Databases::setInstallPath( const OUString& aInstDir ) ExtensionHelpExistenceMap ExtensionIteratorBase::aHelpExistenceMap; ExtensionIteratorBase::ExtensionIteratorBase( Reference< XComponentContext > const & xContext, - Databases& rDatabases, const OUString& aInitialModule, const OUString& aLanguage ) + Databases& rDatabases, OUString aInitialModule, OUString aLanguage ) : m_xContext( xContext ) , m_rDatabases( rDatabases ) , m_eState( IteratorState::InitialModule ) - , m_aInitialModule( aInitialModule ) - , m_aLanguage( aLanguage ) + , m_aInitialModule(std::move( aInitialModule )) + , m_aLanguage(std::move( aLanguage )) { assert( m_xContext.is() ); init(); } ExtensionIteratorBase::ExtensionIteratorBase( Databases& rDatabases, - const OUString& aInitialModule, const OUString& aLanguage ) + OUString aInitialModule, OUString aLanguage ) : m_xContext( comphelper::getProcessComponentContext() ) , m_rDatabases( rDatabases ) , m_eState( IteratorState::InitialModule ) - , m_aInitialModule( aInitialModule ) - , m_aLanguage( aLanguage ) + , m_aInitialModule(std::move( aInitialModule )) + , m_aLanguage(std::move( aLanguage )) { init(); } diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index 9c42d1b08d01..226de5254222 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -25,6 +25,7 @@ #include <string_view> #include <unordered_map> #include <unordered_set> +#include <utility> #include <vector> #include <osl/mutex.hxx> #include <rtl/ustring.hxx> @@ -62,13 +63,13 @@ namespace chelp { public: - StaticModuleInformation( const OUString& aTitle, - const OUString& aStartId, - const OUString& aProgramSwitch, + StaticModuleInformation( OUString aTitle, + OUString aStartId, + OUString aProgramSwitch, std::u16string_view aOrder ) - : m_aStartId( aStartId ), - m_aProgramSwitch( aProgramSwitch ), - m_aTitle( aTitle ), + : m_aStartId(std::move( aStartId )), + m_aProgramSwitch(std::move( aProgramSwitch )), + m_aTitle(std::move( aTitle )), m_nOrder( o3tl::toInt32(aOrder) ) { } @@ -92,7 +93,7 @@ namespace chelp { KeywordElement( Databases const * pDatabases, helpdatafileproxy::Hdf* pHdf, - OUString const & key, + OUString key, std::u16string_view ids ); private: @@ -306,9 +307,9 @@ namespace chelp { public: ExtensionIteratorBase( css::uno::Reference< css::uno::XComponentContext > const & xContext, - Databases& rDatabases, const OUString& aInitialModule, const OUString& aLanguage ); - ExtensionIteratorBase( Databases& rDatabases, const OUString& aInitialModule, - const OUString& aLanguage ); + Databases& rDatabases, OUString aInitialModule, OUString aLanguage ); + ExtensionIteratorBase( Databases& rDatabases, OUString aInitialModule, + OUString aLanguage ); void init(); private: diff --git a/xmlhelp/source/cxxhelp/provider/db.hxx b/xmlhelp/source/cxxhelp/provider/db.hxx index aa02903bd16d..9a63c8f0981b 100644 --- a/xmlhelp/source/cxxhelp/provider/db.hxx +++ b/xmlhelp/source/cxxhelp/provider/db.hxx @@ -68,14 +68,14 @@ namespace helpdatafileproxy { //HDFHelp must get a fileURL which can then directly be used by simple file access. //SimpleFileAccess requires file URLs as arguments. Passing file path may work but fails //for example when using long file paths on Windows, which start with "\\?\" - Hdf( const OUString& rFileURL, - css::uno::Reference< css::ucb::XSimpleFileAccess3 > const & xSFA ) - : m_aFileURL( rFileURL ) - , m_xSFA( xSFA ) + Hdf( OUString aFileURL, + css::uno::Reference< css::ucb::XSimpleFileAccess3 > xSFA ) + : m_aFileURL( std::move(aFileURL) ) + , m_xSFA( std::move(xSFA) ) , m_nItRead( -1 ) , m_iItPos( -1 ) { - OSL_ASSERT(comphelper::isFileUrl(rFileURL)); + OSL_ASSERT(comphelper::isFileUrl(m_aFileURL)); } ~Hdf(); diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx index d08c9f97e508..2f64acaac3c1 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.cxx @@ -23,17 +23,18 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <ucbhelper/resultsetmetadata.hxx> #include <cppuhelper/queryinterface.hxx> +#include <utility> #include "resultsetbase.hxx" using namespace chelp; using namespace com::sun::star; -ResultSetBase::ResultSetBase( const uno::Reference< uno::XComponentContext >& rxContext, - const uno::Reference< ucb::XContentProvider >& xProvider, +ResultSetBase::ResultSetBase( uno::Reference< uno::XComponentContext > xContext, + uno::Reference< ucb::XContentProvider > xProvider, const uno::Sequence< beans::Property >& seq ) - : m_xContext( rxContext ), - m_xProvider( xProvider ), + : m_xContext(std::move( xContext )), + m_xProvider(std::move( xProvider )), m_nRow( -1 ), m_nWasNull( true ), m_sProperty( seq ) diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx index 6ec04f36d60e..00581142669e 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx @@ -49,8 +49,8 @@ namespace chelp { { public: - ResultSetBase( const css::uno::Reference< css::uno::XComponentContext >& rxContext, - const css::uno::Reference< css::ucb::XContentProvider >& xProvider, + ResultSetBase( css::uno::Reference< css::uno::XComponentContext > xContext, + css::uno::Reference< css::ucb::XContentProvider > xProvider, const css::uno::Sequence< css::beans::Property >& seq ); virtual ~ResultSetBase() override; diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx index 3806dd68bdd4..f2a65f45ed3d 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx @@ -41,6 +41,7 @@ #include <algorithm> #include <set> +#include <utility> #include "resultsetforquery.hxx" #include "databases.hxx" @@ -58,8 +59,8 @@ struct HitItem OUString m_aURL; float m_fScore; - HitItem(const OUString& aURL, float fScore) - : m_aURL(aURL) + HitItem(OUString aURL, float fScore) + : m_aURL(std::move(aURL)) , m_fScore(fScore) {} bool operator < ( const HitItem& rHitItem ) const diff --git a/xmlhelp/source/treeview/tvfactory.cxx b/xmlhelp/source/treeview/tvfactory.cxx index ec2790032b6d..04bba6e6f663 100644 --- a/xmlhelp/source/treeview/tvfactory.cxx +++ b/xmlhelp/source/treeview/tvfactory.cxx @@ -26,6 +26,7 @@ #include <cppuhelper/factory.hxx> #include <tvfactory.hxx> #include <tvread.hxx> +#include <utility> using namespace treeview; using namespace com::sun::star; @@ -34,8 +35,8 @@ using namespace com::sun::star::lang; using namespace com::sun::star::beans; using namespace com::sun::star::container; -TVFactory::TVFactory( const uno::Reference< XComponentContext >& xContext ) - : m_xContext( xContext ) +TVFactory::TVFactory( uno::Reference< XComponentContext > xContext ) + : m_xContext(std::move( xContext )) { } diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 1a56533fd27b..cc06309369c2 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -40,6 +40,7 @@ #include <i18nlangtag/languagetag.hxx> #include <unotools/pathoptions.hxx> #include <memory> +#include <utility> namespace treeview { @@ -826,9 +827,9 @@ void TVChildTarget::subst( OUString& instpath ) const char aHelpMediaType[] = "application/vnd.sun.star.help"; -TreeFileIterator::TreeFileIterator( const OUString& aLanguage ) +TreeFileIterator::TreeFileIterator( OUString aLanguage ) : m_eState( IteratorState::UserExtensions ) - , m_aLanguage( aLanguage ) + , m_aLanguage(std::move( aLanguage )) { m_xContext = ::comphelper::getProcessComponentContext(); if( !m_xContext.is() ) |