From 44a11bb8c99e02ac3ac16b405377ea61ffa8841b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 28 Jul 2022 09:49:00 +0200 Subject: 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 --- xmlscript/source/xmldlg_imexp/exp_share.hxx | 13 ++++++------ xmlscript/source/xmldlg_imexp/imp_share.hxx | 27 +++++++++++++------------ xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 5 +++-- 3 files changed, 24 insertions(+), 21 deletions(-) (limited to 'xmlscript/source/xmldlg_imexp') 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 #include #include #include @@ -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 #include #include #include @@ -143,16 +144,16 @@ public: const & getNumberFormatsSupplier(); DialogImport( - css::uno::Reference const & xContext, + css::uno::Reference xContext, css::uno::Reference 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 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 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 #include #include @@ -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 ) { } -- cgit