summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-07-28 09:49:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-07-28 10:42:37 +0200
commit44a11bb8c99e02ac3ac16b405377ea61ffa8841b (patch)
treefb7bac949b877c90518a35bd0278ef3dd51a2779 /xmlsecurity
parent7091a5416e6e1d5ff8c3b40646de30fe1458db24 (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 'xmlsecurity')
-rw-r--r--xmlsecurity/inc/certificateviewer.hxx9
-rw-r--r--xmlsecurity/inc/digitalsignaturesdialog.hxx2
-rw-r--r--xmlsecurity/inc/macrosecurity.hxx2
-rw-r--r--xmlsecurity/inc/xsecctl.hxx2
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx5
-rw-r--r--xmlsecurity/source/dialogs/macrosecurity.cxx5
-rw-r--r--xmlsecurity/source/framework/buffernode.cxx5
-rw-r--r--xmlsecurity/source/framework/buffernode.hxx3
-rw-r--r--xmlsecurity/source/framework/elementcollector.cxx5
-rw-r--r--xmlsecurity/source/framework/elementcollector.hxx2
-rw-r--r--xmlsecurity/source/helper/xsecctl.cxx5
-rw-r--r--xmlsecurity/source/xmlsec/nss/nssinitializer.cxx5
-rw-r--r--xmlsecurity/source/xmlsec/nss/nssinitializer.hxx2
13 files changed, 29 insertions, 23 deletions
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 );