clang-tidy modernize-pass-by-value in unoxml

Change-Id: Id0df30bed0de7db0564816180497406c55cf9fff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136476
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2022-06-27 10:11:58 +02:00
parent 5938687e57
commit 9de4cafcf0
11 changed files with 52 additions and 44 deletions

View file

@ -22,6 +22,7 @@
#include <string.h>
#include <com/sun/star/xml/dom/DOMException.hpp>
#include <utility>
#include "element.hxx"
#include "document.hxx"
@ -31,9 +32,9 @@ using namespace css::xml::dom;
namespace DOM
{
CAttributesMap::CAttributesMap(::rtl::Reference<CElement> const& pElement,
CAttributesMap::CAttributesMap(::rtl::Reference<CElement> pElement,
::osl::Mutex & rMutex)
: m_pElement(pElement)
: m_pElement(std::move(pElement))
, m_rMutex(rMutex)
{
}

View file

@ -42,7 +42,7 @@ namespace DOM
::osl::Mutex & m_rMutex;
public:
CAttributesMap(::rtl::Reference<CElement> const& pElement,
CAttributesMap(::rtl::Reference<CElement> pElement,
::osl::Mutex & rMutex);
/**

View file

@ -22,6 +22,7 @@
#include <libxml/tree.h>
#include <node.hxx>
#include <utility>
#include "document.hxx"
using namespace css::uno;
@ -29,9 +30,9 @@ using namespace css::xml::dom;
namespace DOM
{
CChildList::CChildList(::rtl::Reference<CNode> const& pBase,
CChildList::CChildList(::rtl::Reference<CNode> pBase,
::osl::Mutex & rMutex)
: m_pNode(pBase)
: m_pNode(std::move(pBase))
, m_rMutex(rMutex)
{
}

View file

@ -42,7 +42,7 @@ namespace DOM
::osl::Mutex & m_rMutex;
public:
CChildList(::rtl::Reference<CNode> const& pBase,
CChildList(::rtl::Reference<CNode> pBase,
::osl::Mutex & rMutex);
/**

View file

@ -24,6 +24,7 @@
#include <cppuhelper/implbase.hxx>
#include <o3tl/safeint.hxx>
#include <utility>
#include <tools/diagnose_ex.h>
#include "element.hxx"
@ -78,10 +79,10 @@ namespace DOM
}
}
CElementListImpl::CElementListImpl(::rtl::Reference<CElement> const& pElement,
CElementListImpl::CElementListImpl(::rtl::Reference<CElement> pElement,
::osl::Mutex & rMutex,
std::u16string_view rName, OUString const*const pURI)
: m_pElement(pElement)
: m_pElement(std::move(pElement))
, m_rMutex(rMutex)
, m_pName(lcl_initXmlString(rName))
, m_pURI(pURI ? lcl_initXmlString(*pURI) : nullptr)

View file

@ -60,7 +60,7 @@ namespace DOM
void buildlist(xmlNodePtr pNode, bool start=true);
public:
CElementListImpl(::rtl::Reference<CElement> const& pElement,
CElementListImpl(::rtl::Reference<CElement> pElement,
::osl::Mutex & rMutex,
std::u16string_view rName, OUString const*const pURI);

View file

@ -65,6 +65,7 @@
#include <comphelper/xmltools.hxx>
#include <com/sun/star/embed/XEncryptionProtectedSource2.hpp>
#include <utility>
/**
Implementation of the service com.sun.star.rdf.Repository.
@ -183,15 +184,15 @@ public:
struct URI : public Resource
{
OString const value;
explicit URI(OString const& i_rValue)
: value(i_rValue)
explicit URI(OString i_Value)
: value(std::move(i_Value))
{ }
};
struct BlankNode : public Resource
{
OString const value;
explicit BlankNode(OString const& i_rValue)
: value(i_rValue)
explicit BlankNode(OString i_Value)
: value(std::move(i_Value))
{ }
};
struct Literal : public Node
@ -199,11 +200,11 @@ public:
OString const value;
OString const language;
::std::optional<OString> const type;
Literal(OString const& i_rValue, OString const& i_rLanguage,
::std::optional<OString> const& i_rType)
: value(i_rValue)
, language(i_rLanguage)
, type(i_rType)
Literal(OString i_rValue, OString i_Language,
::std::optional<OString> i_Type)
: value(std::move(i_rValue))
, language(std::move(i_Language))
, type(std::move(i_Type))
{ }
};
struct Statement
@ -211,19 +212,19 @@ public:
std::shared_ptr<Resource> const pSubject;
std::shared_ptr<URI> const pPredicate;
std::shared_ptr<Node> const pObject;
Statement(std::shared_ptr<Resource> const& i_pSubject,
std::shared_ptr<URI> const& i_pPredicate,
std::shared_ptr<Node> const& i_pObject)
: pSubject(i_pSubject)
, pPredicate(i_pPredicate)
, pObject(i_pObject)
Statement(std::shared_ptr<Resource> i_pSubject,
std::shared_ptr<URI> i_pPredicate,
std::shared_ptr<Node> i_pObject)
: pSubject(std::move(i_pSubject))
, pPredicate(std::move(i_pPredicate))
, pObject(std::move(i_pObject))
{ }
};
librdf_TypeConverter(
uno::Reference< uno::XComponentContext > const & i_xContext,
uno::Reference< uno::XComponentContext > i_xContext,
librdf_Repository &i_rRep)
: m_xContext(i_xContext)
: m_xContext(std::move(i_xContext))
, m_rRep(i_rRep)
{ };
@ -429,15 +430,15 @@ public:
librdf_GraphResult(librdf_Repository *i_pRepository,
std::mutex & i_rMutex,
std::shared_ptr<librdf_stream> const& i_pStream,
std::shared_ptr<librdf_node> const& i_pContext,
std::shared_ptr<librdf_query> const& i_pQuery =
std::shared_ptr<librdf_stream> i_pStream,
std::shared_ptr<librdf_node> i_pContext,
std::shared_ptr<librdf_query> i_pQuery =
std::shared_ptr<librdf_query>() )
: m_xRep(i_pRepository)
, m_rMutex(i_rMutex)
, m_pQuery(i_pQuery)
, m_pContext(i_pContext)
, m_pStream(i_pStream)
, m_pQuery(std::move(i_pQuery))
, m_pContext(std::move(i_pContext))
, m_pStream(std::move(i_pStream))
{ };
virtual ~librdf_GraphResult() override
@ -581,13 +582,13 @@ public:
librdf_QuerySelectResult(librdf_Repository *i_pRepository,
std::mutex & i_rMutex,
std::shared_ptr<librdf_query> const& i_pQuery,
std::shared_ptr<librdf_query_results> const& i_pQueryResult,
std::shared_ptr<librdf_query> i_pQuery,
std::shared_ptr<librdf_query_results> i_pQueryResult,
uno::Sequence< OUString > const& i_rBindingNames )
: m_xRep(i_pRepository)
, m_rMutex(i_rMutex)
, m_pQuery(i_pQuery)
, m_pQueryResult(i_pQueryResult)
, m_pQuery(std::move(i_pQuery))
, m_pQueryResult(std::move(i_pQueryResult))
, m_BindingNames(i_rBindingNames)
{ };
@ -695,10 +696,10 @@ class librdf_NamedGraph:
{
public:
librdf_NamedGraph(librdf_Repository * i_pRep,
uno::Reference<rdf::XURI> const & i_xName)
uno::Reference<rdf::XURI> i_xName)
: m_wRep(i_pRep)
, m_pRep(i_pRep)
, m_xName(i_xName)
, m_xName(std::move(i_xName))
{ };
// css::rdf::XNode:

View file

@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <utility>
#include "nodelist.hxx"
#include "../dom/document.hxx"
@ -27,10 +29,10 @@ using namespace css::xml::dom;
namespace XPath
{
CNodeList::CNodeList(
::rtl::Reference<DOM::CDocument> const& pDocument,
::rtl::Reference<DOM::CDocument> pDocument,
::osl::Mutex & rMutex,
std::shared_ptr<xmlXPathObject> const& rxpathObj)
: m_pDocument(pDocument)
: m_pDocument(std::move(pDocument))
, m_rMutex(rMutex)
, m_pNodeSet(nullptr)
{

View file

@ -53,7 +53,7 @@ namespace XPath
public:
CNodeList(
::rtl::Reference<DOM::CDocument> const& pDocument,
::rtl::Reference<DOM::CDocument> pDocument,
::osl::Mutex & rMutex,
std::shared_ptr<xmlXPathObject> const& rxpathObj);
/**

View file

@ -21,6 +21,8 @@
#include <string.h>
#include <utility>
#include "../dom/document.hxx"
#include "nodelist.hxx"
@ -60,10 +62,10 @@ namespace XPath
}
CXPathObject::CXPathObject(
::rtl::Reference<DOM::CDocument> const& pDocument,
::rtl::Reference<DOM::CDocument> pDocument,
::osl::Mutex & rMutex,
std::shared_ptr<xmlXPathObject> const& pXPathObj)
: m_pDocument(pDocument)
: m_pDocument(std::move(pDocument))
, m_rMutex(rMutex)
, m_pXPathObj(pXPathObj)
, m_XPathObjectType(lcl_GetType(pXPathObj.get()))

View file

@ -49,7 +49,7 @@ namespace XPath
css::xml::xpath::XPathObjectType const m_XPathObjectType;
public:
CXPathObject( ::rtl::Reference<DOM::CDocument> const& pDocument,
CXPathObject( ::rtl::Reference<DOM::CDocument> pDocument,
::osl::Mutex & rMutex,
std::shared_ptr<xmlXPathObject> const& pXPathObj);