xmlhelp/source/cxxhelp/inc/tvfactory.hxx | 2 - xmlhelp/source/cxxhelp/inc/tvread.hxx | 2 - xmlhelp/source/cxxhelp/provider/content.cxx | 25 ++++++++------- xmlhelp/source/cxxhelp/provider/databases.cxx | 17 +++++----- xmlhelp/source/cxxhelp/provider/databases.hxx | 21 ++++++------- xmlhelp/source/cxxhelp/provider/db.hxx | 10 +++--- xmlhelp/source/cxxhelp/provider/resultsetbase.cxx | 9 +++-- xmlhelp/source/cxxhelp/provider/resultsetbase.hxx | 4 +- xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx | 5 +-- xmlhelp/source/treeview/tvfactory.cxx | 5 +-- xmlhelp/source/treeview/tvread.cxx | 5 +-- xmlscript/source/xmldlg_imexp/exp_share.hxx | 13 ++++---- xmlscript/source/xmldlg_imexp/imp_share.hxx | 27 ++++++++--------- xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 5 +-- xmlscript/source/xmllib_imexp/imp_share.hxx | 2 - xmlscript/source/xmllib_imexp/xmllib_import.cxx | 5 +-- xmlscript/source/xmlmod_imexp/imp_share.hxx | 2 - xmlscript/source/xmlmod_imexp/xmlmod_import.cxx | 5 +-- xmlsecurity/inc/certificateviewer.hxx | 9 +++-- xmlsecurity/inc/digitalsignaturesdialog.hxx | 2 - xmlsecurity/inc/macrosecurity.hxx | 2 - xmlsecurity/inc/xsecctl.hxx | 2 - xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 5 +-- xmlsecurity/source/dialogs/macrosecurity.cxx | 5 +-- xmlsecurity/source/framework/buffernode.cxx | 5 +-- xmlsecurity/source/framework/buffernode.hxx | 3 - xmlsecurity/source/framework/elementcollector.cxx | 5 +-- xmlsecurity/source/framework/elementcollector.hxx | 2 - xmlsecurity/source/helper/xsecctl.cxx | 5 +-- xmlsecurity/source/xmlsec/nss/nssinitializer.cxx | 5 +-- xmlsecurity/source/xmlsec/nss/nssinitializer.hxx | 2 - 31 files changed, 117 insertions(+), 99 deletions(-)
New commits: commit 44a11bb8c99e02ac3ac16b405377ea61ffa8841b Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jul 28 09:49:00 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Jul 28 10:42:37 2022 +0200 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.gran...@collabora.co.uk> 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() ) diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx index 919950c79bef..55a53bcc13b8 100644 --- a/xmlscript/source/xmldlg_imexp/exp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx @@ -19,6 +19,7 @@ #pragma once +#include <utility> #include <xmlscript/xmldlg_imexp.hxx> #include <xmlscript/xml_helper.hxx> #include <osl/diagnose.h> @@ -93,13 +94,13 @@ class ElementDescriptor public: ElementDescriptor( - css::uno::Reference< css::beans::XPropertySet > const & xProps, - css::uno::Reference< css::beans::XPropertyState > const & xPropState, - OUString const & name, css::uno::Reference< css::frame::XModel > const & xDocument ) + css::uno::Reference< css::beans::XPropertySet > xProps, + css::uno::Reference< css::beans::XPropertyState > xPropState, + OUString const & name, css::uno::Reference< css::frame::XModel > xDocument ) : XMLElement( name ) - , _xProps( xProps ) - , _xPropState( xPropState ) - , _xDocument( xDocument ) + , _xProps(std::move( xProps )) + , _xPropState(std::move( xPropState )) + , _xDocument(std::move( xDocument )) {} explicit ElementDescriptor( OUString const & name ) diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index 12da217242de..ef418446998a 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -19,6 +19,7 @@ #pragma once +#include <utility> #include <xmlscript/xmldlg_imexp.hxx> #include <cppuhelper/implbase.hxx> #include <com/sun/star/uno/XComponentContext.hpp> @@ -143,16 +144,16 @@ public: const & getNumberFormatsSupplier(); DialogImport( - css::uno::Reference<css::uno::XComponentContext> const & xContext, + css::uno::Reference<css::uno::XComponentContext> xContext, css::uno::Reference<css::container::XNameContainer> const & xDialogModel, - std::shared_ptr< std::vector< OUString > > const & pStyleNames, - std::shared_ptr< std::vector< css::uno::Reference< css::xml::input::XElement > > > const & pStyles, - css::uno::Reference<css::frame::XModel> const & xDoc ) - : _xContext( xContext ) - , _pStyleNames( pStyleNames ) - , _pStyles( pStyles ) - , _xDoc( xDoc ) + std::shared_ptr< std::vector< OUString > > pStyleNames, + std::shared_ptr< std::vector< css::uno::Reference< css::xml::input::XElement > > > pStyles, + css::uno::Reference<css::frame::XModel> xDoc ) + : _xContext(std::move( xContext )) + , _pStyleNames(std::move( pStyleNames )) + , _pStyles(std::move( pStyles )) + , _xDoc(std::move( xDoc )) , _xDialogModel( xDialogModel ) , _xDialogModelFactory( xDialogModel, css::uno::UNO_QUERY_THROW ) , XMLNS_DIALOGS_UID( 0 ) @@ -204,7 +205,7 @@ protected: public: ElementBase( - sal_Int32 nUid, OUString const & rLocalName, + sal_Int32 nUid, OUString aLocalName, css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, ElementBase * pParent, DialogImport * pImport ); virtual ~ElementBase() override; @@ -371,11 +372,11 @@ protected: public: ImportContext( DialogImport * pImport, - css::uno::Reference< css::beans::XPropertySet > const & xControlModel_, - OUString const & id ) + css::uno::Reference< css::beans::XPropertySet > xControlModel_, + OUString id ) : _pImport( pImport ), - _xControlModel( xControlModel_ ), - _aId( id ) + _xControlModel(std::move( xControlModel_ )), + _aId(std::move( id )) { OSL_ASSERT( _xControlModel.is() ); } const css::uno::Reference< css::beans::XPropertySet >& getControlModel() const diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index 5cac12605faf..ffe491405b92 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -19,6 +19,7 @@ #include "common.hxx" #include "imp_share.hxx" +#include <utility> #include <xml_import.hxx> #include <xmlscript/xmlns.h> @@ -1659,13 +1660,13 @@ Reference< xml::input::XElement > ElementBase::startChildElement( } ElementBase::ElementBase( - sal_Int32 nUid, OUString const & rLocalName, + sal_Int32 nUid, OUString aLocalName, Reference< xml::input::XAttributes > const & xAttributes, ElementBase * pParent, DialogImport * pImport ) : m_pImport( pImport ) , m_pParent( pParent ) , _nUid( nUid ) - , _aLocalName( rLocalName ) + , _aLocalName(std::move(aLocalName )) , _xAttributes( xAttributes ) { } diff --git a/xmlscript/source/xmllib_imexp/imp_share.hxx b/xmlscript/source/xmllib_imexp/imp_share.hxx index d9ec1c442402..5798c13b92b6 100644 --- a/xmlscript/source/xmllib_imexp/imp_share.hxx +++ b/xmlscript/source/xmllib_imexp/imp_share.hxx @@ -153,7 +153,7 @@ private: public: LibElementBase( - OUString const & rLocalName, + OUString aLocalName, css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, LibElementBase * pParent, LibraryImport * pImport ); virtual ~LibElementBase() override; diff --git a/xmlscript/source/xmllib_imexp/xmllib_import.cxx b/xmlscript/source/xmllib_imexp/xmllib_import.cxx index 02c46a65f239..2666089c4766 100644 --- a/xmlscript/source/xmllib_imexp/xmllib_import.cxx +++ b/xmlscript/source/xmllib_imexp/xmllib_import.cxx @@ -22,6 +22,7 @@ #include <sal/log.hxx> #include "imp_share.hxx" +#include <utility> #include <xml_import.hxx> #include <xmlscript/xmlns.h> @@ -77,12 +78,12 @@ Reference< xml::input::XElement > LibElementBase::startChildElement( } LibElementBase::LibElementBase( - OUString const & rLocalName, + OUString aLocalName, Reference< xml::input::XAttributes > const & xAttributes, LibElementBase * pParent, LibraryImport * pImport ) : mxImport( pImport ) , mxParent( pParent ) - , _aLocalName( rLocalName ) + , _aLocalName(std::move( aLocalName )) , _xAttributes( xAttributes ) { } diff --git a/xmlscript/source/xmlmod_imexp/imp_share.hxx b/xmlscript/source/xmlmod_imexp/imp_share.hxx index f914c973bdd1..62bde2e30a00 100644 --- a/xmlscript/source/xmlmod_imexp/imp_share.hxx +++ b/xmlscript/source/xmlmod_imexp/imp_share.hxx @@ -74,7 +74,7 @@ class ModuleElement public: ModuleElement( - OUString const & rLocalName, + OUString aLocalName, css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, ModuleImport * pImport ); virtual ~ModuleElement() override; diff --git a/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx b/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx index 2751d9856c18..5d84d9a07adf 100644 --- a/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx +++ b/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx @@ -24,6 +24,7 @@ #include <sal/log.hxx> #include "imp_share.hxx" +#include <utility> #include <xml_import.hxx> using namespace css; @@ -78,11 +79,11 @@ Reference< xml::input::XElement > ModuleElement::startChildElement( } ModuleElement::ModuleElement( - OUString const & rLocalName, + OUString aLocalName, Reference< xml::input::XAttributes > const & xAttributes, ModuleImport * pImport ) : mxImport( pImport ) - , _aLocalName( rLocalName ) + , _aLocalName(std::move( aLocalName )) , _xAttributes( xAttributes ) { } diff --git a/xmlsecurity/inc/certificateviewer.hxx b/xmlsecurity/inc/certificateviewer.hxx index ea47c41029a8..8aeb5f3368ff 100644 --- a/xmlsecurity/inc/certificateviewer.hxx +++ b/xmlsecurity/inc/certificateviewer.hxx @@ -19,6 +19,7 @@ #pragma once +#include <utility> #include <vcl/weld.hxx> namespace com::sun::star { @@ -93,8 +94,8 @@ struct Details_UserDatat OUString const maTxt; bool const mbFixedWidthFont; - Details_UserDatat(const OUString& rTxt, bool bFixedWidthFont) - : maTxt(rTxt) + Details_UserDatat(OUString aTxt, bool bFixedWidthFont) + : maTxt(std::move(aTxt)) , mbFixedWidthFont(bFixedWidthFont) { } @@ -120,8 +121,8 @@ struct CertPath_UserData css::uno::Reference< css::security::XCertificate > mxCert; bool const mbValid; - CertPath_UserData(css::uno::Reference<css::security::XCertificate> const & xCert, bool bValid) - : mxCert(xCert) + CertPath_UserData(css::uno::Reference<css::security::XCertificate> xCert, bool bValid) + : mxCert(std::move(xCert)) , mbValid(bValid) { } diff --git a/xmlsecurity/inc/digitalsignaturesdialog.hxx b/xmlsecurity/inc/digitalsignaturesdialog.hxx index 28ed32ccb098..218c3e99c8b3 100644 --- a/xmlsecurity/inc/digitalsignaturesdialog.hxx +++ b/xmlsecurity/inc/digitalsignaturesdialog.hxx @@ -105,7 +105,7 @@ private: public: DigitalSignaturesDialog(weld::Window* pParent, const css::uno::Reference< css::uno::XComponentContext >& rxCtx, DocumentSignatureMode eMode, - bool bReadOnly, const OUString& sODFVersion, bool bHasDocumentSignature); + bool bReadOnly, OUString sODFVersion, bool bHasDocumentSignature); virtual ~DigitalSignaturesDialog() override; // Initialize the dialog and the security environment, returns TRUE on success diff --git a/xmlsecurity/inc/macrosecurity.hxx b/xmlsecurity/inc/macrosecurity.hxx index 233ef2c1dca1..52c45ecb3743 100644 --- a/xmlsecurity/inc/macrosecurity.hxx +++ b/xmlsecurity/inc/macrosecurity.hxx @@ -44,7 +44,7 @@ private: DECL_LINK(OkBtnHdl, weld::Button&, void); public: MacroSecurity(weld::Window* pParent, - const css::uno::Reference<css::xml::crypto::XSecurityEnvironment>& rxSecurityEnvironment); + css::uno::Reference<css::xml::crypto::XSecurityEnvironment> xSecurityEnvironment); void EnableReset(bool bEnable = true) { diff --git a/xmlsecurity/inc/xsecctl.hxx b/xmlsecurity/inc/xsecctl.hxx index adfd251b172e..adefe7e087ae 100644 --- a/xmlsecurity/inc/xsecctl.hxx +++ b/xmlsecurity/inc/xsecctl.hxx @@ -291,7 +291,7 @@ private: sal_Int32 nSecurityId ); public: - explicit XSecController(const css::uno::Reference<css::uno::XComponentContext>& rxCtx); + explicit XSecController(css::uno::Reference<css::uno::XComponentContext> xCtx); virtual ~XSecController() override; sal_Int32 getNewSecurityId( ); diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 1d40e7562be1..8df004e97fd3 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -60,6 +60,7 @@ #include <comphelper/xmlsechelper.hxx> #include <comphelper/processfactory.hxx> +#include <utility> #include <vcl/weld.hxx> #include <vcl/svapp.hxx> #include <unotools/configitem.hxx> @@ -119,10 +120,10 @@ namespace DigitalSignaturesDialog::DigitalSignaturesDialog( weld::Window* pParent, const uno::Reference< uno::XComponentContext >& rxCtx, DocumentSignatureMode eMode, - bool bReadOnly, const OUString& sODFVersion, bool bHasDocumentSignature) + bool bReadOnly, OUString sODFVersion, bool bHasDocumentSignature) : GenericDialogController(pParent, "xmlsec/ui/digitalsignaturesdialog.ui", "DigitalSignaturesDialog") , maSignatureManager(rxCtx, eMode) - , m_sODFVersion (sODFVersion) + , m_sODFVersion (std::move(sODFVersion)) , m_bHasDocumentSignature(bHasDocumentSignature) , m_bWarningShowSignMacro(false) , m_xHintDocFT(m_xBuilder->weld_label("dochint")) diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx index bf82606f4287..8aaf454a7ca9 100644 --- a/xmlsecurity/source/dialogs/macrosecurity.cxx +++ b/xmlsecurity/source/dialogs/macrosecurity.cxx @@ -40,6 +40,7 @@ #include <tools/urlobj.hxx> #include <unotools/datetime.hxx> +#include <utility> #include <vcl/svapp.hxx> using namespace comphelper; @@ -54,9 +55,9 @@ IMPL_LINK_NOARG(MacroSecurity, OkBtnHdl, weld::Button&, void) } MacroSecurity::MacroSecurity(weld::Window* pParent, - const css::uno::Reference<css::xml::crypto::XSecurityEnvironment>& rxSecurityEnvironment) + css::uno::Reference<css::xml::crypto::XSecurityEnvironment> xSecurityEnvironment) : GenericDialogController(pParent, "xmlsec/ui/macrosecuritydialog.ui", "MacroSecurityDialog") - , m_xSecurityEnvironment(rxSecurityEnvironment) + , m_xSecurityEnvironment(std::move(xSecurityEnvironment)) , m_xTabCtrl(m_xBuilder->weld_notebook("tabcontrol")) , m_xOkBtn(m_xBuilder->weld_button("ok")) , m_xResetBtn(m_xBuilder->weld_button("reset")) diff --git a/xmlsecurity/source/framework/buffernode.cxx b/xmlsecurity/source/framework/buffernode.cxx index cc6c37c18aee..4dfa9fbfe20b 100644 --- a/xmlsecurity/source/framework/buffernode.cxx +++ b/xmlsecurity/source/framework/buffernode.cxx @@ -24,12 +24,13 @@ #include <com/sun/star/xml/crypto/sax/ConstOfSecurityId.hpp> #include <osl/diagnose.h> #include <rtl/ustrbuf.hxx> +#include <utility> -BufferNode::BufferNode( const css::uno::Reference< css::xml::wrapper::XXMLElementWrapper >& xXMLElement ) +BufferNode::BufferNode( css::uno::Reference< css::xml::wrapper::XXMLElementWrapper > xXMLElement ) :m_pParent(nullptr), m_pBlocker(nullptr), m_bAllReceived(false), - m_xXMLElement(xXMLElement) + m_xXMLElement(std::move(xXMLElement)) { } diff --git a/xmlsecurity/source/framework/buffernode.hxx b/xmlsecurity/source/framework/buffernode.hxx index 0202195de99a..f59ae2f8168a 100644 --- a/xmlsecurity/source/framework/buffernode.hxx +++ b/xmlsecurity/source/framework/buffernode.hxx @@ -80,8 +80,7 @@ private: const BufferNode* getNextChild(const BufferNode* pChild) const; public: - explicit BufferNode( - const css::uno::Reference<css::xml::wrapper::XXMLElementWrapper>& xXMLElement); + explicit BufferNode(css::uno::Reference<css::xml::wrapper::XXMLElementWrapper> xXMLElement); bool isECOfBeforeModifyIncluded(sal_Int32 nIgnoredSecurityId) const; void setReceivedAll(); diff --git a/xmlsecurity/source/framework/elementcollector.cxx b/xmlsecurity/source/framework/elementcollector.cxx index 7801d6328b7f..d8f7fb04e776 100644 --- a/xmlsecurity/source/framework/elementcollector.cxx +++ b/xmlsecurity/source/framework/elementcollector.cxx @@ -22,18 +22,19 @@ #include "elementcollector.hxx" #include <com/sun/star/xml/crypto/sax/ConstOfSecurityId.hpp> #include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp> +#include <utility> ElementCollector::ElementCollector( sal_Int32 nBufferId, css::xml::crypto::sax::ElementMarkPriority nPriority, bool bToModify, - const css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener >& xReferenceResolvedListener) + css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener > xReferenceResolvedListener) :ElementMark(css::xml::crypto::sax::ConstOfSecurityId::UNDEFINEDSECURITYID, nBufferId), m_nPriority(nPriority), m_bToModify(bToModify), m_bAbleToNotify(false), m_bNotified(false), - m_xReferenceResolvedListener(xReferenceResolvedListener) + m_xReferenceResolvedListener(std::move(xReferenceResolvedListener)) /****** ElementCollector/ElementCollector ************************************* * * NAME diff --git a/xmlsecurity/source/framework/elementcollector.hxx b/xmlsecurity/source/framework/elementcollector.hxx index 0f797572a487..29447e882bba 100644 --- a/xmlsecurity/source/framework/elementcollector.hxx +++ b/xmlsecurity/source/framework/elementcollector.hxx @@ -67,7 +67,7 @@ public: sal_Int32 nBufferId, css::xml::crypto::sax::ElementMarkPriority nPriority, bool bToModify, - const css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener >& xReferenceResolvedListener); + css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener > xReferenceResolvedListener); css::xml::crypto::sax::ElementMarkPriority getPriority() const { return m_nPriority;} bool getModify() const { return m_bToModify;} diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx index 5a9bf57ec061..5fcc5949b7e0 100644 --- a/xmlsecurity/source/helper/xsecctl.cxx +++ b/xmlsecurity/source/helper/xsecctl.cxx @@ -19,6 +19,7 @@ #include <config_gpgme.h> +#include <utility> #include <xsecctl.hxx> #include <documentsignaturehelper.hxx> #include <framework/saxeventkeeperimpl.hxx> @@ -98,8 +99,8 @@ OUString getSignatureURI(svl::crypto::SignatureMethodAlgorithm eAlgorithm, sal_I } } -XSecController::XSecController( const css::uno::Reference<css::uno::XComponentContext>& rxCtx ) - : mxCtx(rxCtx) +XSecController::XSecController( css::uno::Reference<css::uno::XComponentContext> xCtx ) + : mxCtx(std::move(xCtx)) , m_nNextSecurityId(1) , m_bIsPreviousNodeInitializable(false) , m_bIsSAXEventKeeperConnected(false) diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx index 29b26734e04a..2e4b1c4b3380 100644 --- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx +++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx @@ -43,6 +43,7 @@ #include <cstddef> #include <memory> +#include <utility> #include <vector> #include <nss.h> @@ -307,8 +308,8 @@ sal_Bool SAL_CALL ONSSInitializer::getIsNSSinitialized() return m_bIsNSSinitialized; } -ONSSInitializer::ONSSInitializer(const css::uno::Reference< css::uno::XComponentContext > &rxContext) - : m_xContext(rxContext) +ONSSInitializer::ONSSInitializer(css::uno::Reference< css::uno::XComponentContext > xContext) + : m_xContext(std::move(xContext)) { } diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.hxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.hxx index fa861c298cab..33206773d7a6 100644 --- a/xmlsecurity/source/xmlsec/nss/nssinitializer.hxx +++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.hxx @@ -42,7 +42,7 @@ protected: ONSSInitializer(); public: - explicit ONSSInitializer(const css::uno::Reference<css::uno::XComponentContext> &rxContext); + explicit ONSSInitializer(css::uno::Reference<css::uno::XComponentContext> xContext); virtual ~ONSSInitializer() override; static bool initNSS( const css::uno::Reference< css::uno::XComponentContext > &rxContext );