summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-06-03 14:13:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-06-03 18:32:32 +0200
commit5a6b4b4f288621772991269180aa3a2cffff01af (patch)
tree8f29ed7593c8e54dc62a1ffcc41f3570eb984064 /svl
parentf0b7b388ae06d95007b69812bcf844ac9bed15c4 (diff)
clang-tidy modernize-pass-by-value in svl
Change-Id: I184efd7aee2c3eb02399100a4a7500951255d423 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135357 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/inc/poolio.hxx5
-rw-r--r--svl/source/items/macitem.cxx5
-rw-r--r--svl/source/items/style.cxx5
-rw-r--r--svl/source/misc/lockfilecommon.cxx5
-rw-r--r--svl/source/misc/strmadpt.cxx10
-rw-r--r--svl/source/numbers/numfmuno.cxx13
-rw-r--r--svl/source/numbers/numfmuno.hxx6
-rw-r--r--svl/source/numbers/supservs.cxx5
-rw-r--r--svl/source/numbers/supservs.hxx2
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.hxx13
-rw-r--r--svl/source/undo/undo.cxx9
11 files changed, 43 insertions, 35 deletions
diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx
index 1080672b09ff..cc406f31e0a0 100644
--- a/svl/source/inc/poolio.hxx
+++ b/svl/source/inc/poolio.hxx
@@ -26,6 +26,7 @@
#include <tools/debug.hxx>
#include <memory>
#include <o3tl/sorted_vector.hxx>
+#include <utility>
class SfxPoolItem;
class SfxItemPoolUser;
@@ -162,9 +163,9 @@ struct SfxItemPool_Impl
sal_uInt16 mnEnd;
MapUnit eDefMetric;
- SfxItemPool_Impl( SfxItemPool* pMaster, const OUString& rName, sal_uInt16 nStart, sal_uInt16 nEnd )
+ SfxItemPool_Impl( SfxItemPool* pMaster, OUString _aName, sal_uInt16 nStart, sal_uInt16 nEnd )
: maPoolItemArrays(nEnd - nStart + 1)
- , aName(rName)
+ , aName(std::move(_aName))
, maPoolDefaults(nEnd - nStart + 1)
, mpStaticDefaults(nullptr)
, mpMaster(pMaster)
diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx
index b0750212e3dc..4dae21dd4fc9 100644
--- a/svl/source/items/macitem.cxx
+++ b/svl/source/items/macitem.cxx
@@ -27,9 +27,10 @@
#include <svl/macitem.hxx>
#include <stringio.hxx>
#include <algorithm>
+#include <utility>
-SvxMacro::SvxMacro( const OUString &rMacName, const OUString &rLanguage)
- : aMacName( rMacName ), aLibName( rLanguage),
+SvxMacro::SvxMacro( OUString _aMacName, const OUString &rLanguage)
+ : aMacName(std::move( _aMacName )), aLibName( rLanguage),
eType( EXTENDED_STYPE)
{
if ( rLanguage == SVX_MACRO_LANGUAGE_STARBASIC )
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 4e7655a9ae08..50952a8857d2 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -34,6 +34,7 @@
#include <unotools/syslocale.hxx>
#include <comphelper/servicehelper.hxx>
#include <rtl/ustrbuf.hxx>
+#include <utility>
#ifdef DBG_UTIL
namespace {
@@ -62,11 +63,11 @@ static DbgStyleSheetReferences aDbgStyleSheetReferences;
SfxStyleSheetModifiedHint::SfxStyleSheetModifiedHint
(
- const OUString& rOldName,
+ OUString aOldName,
SfxStyleSheetBase& rStyleSheet // Remains with the caller
)
: SfxStyleSheetHint( SfxHintId::StyleSheetModified, rStyleSheet ),
- aName( rOldName )
+ aName(std::move( aOldName ))
{}
diff --git a/svl/source/misc/lockfilecommon.cxx b/svl/source/misc/lockfilecommon.cxx
index baed8636ecfb..982ce7ce02da 100644
--- a/svl/source/misc/lockfilecommon.cxx
+++ b/svl/source/misc/lockfilecommon.cxx
@@ -41,14 +41,15 @@
#include <salhelper/linkhelper.hxx>
#include <svl/lockfilecommon.hxx>
+#include <utility>
using namespace ::com::sun::star;
namespace svt {
-LockFileCommon::LockFileCommon(const OUString& aLockFileURL)
- : m_aURL(aLockFileURL)
+LockFileCommon::LockFileCommon(OUString aLockFileURL)
+ : m_aURL(std::move(aLockFileURL))
{
}
diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx
index d99aae4687ce..7a755d924986 100644
--- a/svl/source/misc/strmadpt.cxx
+++ b/svl/source/misc/strmadpt.cxx
@@ -31,6 +31,7 @@
#include <osl/diagnose.h>
#include <svl/instrm.hxx>
#include <svl/outstrm.hxx>
+#include <utility>
using namespace com::sun::star;
@@ -313,8 +314,8 @@ void SvInputStream::SetSize(sal_uInt64)
SetError(ERRCODE_IO_NOTSUPPORTED);
}
-SvInputStream::SvInputStream( css::uno::Reference< css::io::XInputStream > const & rTheStream):
- m_xStream(rTheStream),
+SvInputStream::SvInputStream( css::uno::Reference< css::io::XInputStream > xTheStream):
+ m_xStream(std::move(xTheStream)),
m_nSeekedFrom(STREAM_SEEK_TO_END)
{
SetBufferSize(0);
@@ -408,9 +409,8 @@ void SvOutputStream::SetSize(sal_uInt64)
SetError(ERRCODE_IO_NOTSUPPORTED);
}
-SvOutputStream::SvOutputStream(uno::Reference< io::XOutputStream > const &
- rTheStream):
- m_xStream(rTheStream)
+SvOutputStream::SvOutputStream(uno::Reference< io::XOutputStream > xTheStream):
+ m_xStream(std::move(xTheStream))
{
SetBufferSize(0);
}
diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx
index a17a71a81947..98ead86e432d 100644
--- a/svl/source/numbers/numfmuno.cxx
+++ b/svl/source/numbers/numfmuno.cxx
@@ -36,6 +36,7 @@
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
#include <svl/itemprop.hxx>
+#include <utility>
using namespace com::sun::star;
@@ -344,9 +345,9 @@ uno::Sequence<OUString> SAL_CALL SvNumberFormatterServiceObj::getSupportedServic
return { "com.sun.star.util.NumberFormatter" };
}
-SvNumberFormatsObj::SvNumberFormatsObj( SvNumberFormatsSupplierObj& _rParent, ::comphelper::SharedMutex const & _rMutex )
+SvNumberFormatsObj::SvNumberFormatsObj( SvNumberFormatsSupplierObj& _rParent, ::comphelper::SharedMutex _aMutex )
:m_xSupplier( &_rParent )
- ,m_aMutex( _rMutex )
+ ,m_aMutex(std::move( _aMutex ))
{
}
@@ -584,10 +585,10 @@ uno::Sequence<OUString> SAL_CALL SvNumberFormatsObj::getSupportedServiceNames()
return { "com.sun.star.util.NumberFormats" };
}
-SvNumberFormatObj::SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, sal_uLong nK, const ::comphelper::SharedMutex& _rMutex )
+SvNumberFormatObj::SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, sal_uLong nK, ::comphelper::SharedMutex _aMutex )
:m_xSupplier( &rParent )
,nKey( nK )
- ,m_aMutex( _rMutex )
+ ,m_aMutex(std::move( _aMutex ))
{
}
@@ -794,9 +795,9 @@ uno::Sequence<OUString> SAL_CALL SvNumberFormatObj::getSupportedServiceNames()
return { "com.sun.star.util.NumberFormatProperties" };
}
-SvNumberFormatSettingsObj::SvNumberFormatSettingsObj( SvNumberFormatsSupplierObj& rParent, const ::comphelper::SharedMutex& _rMutex )
+SvNumberFormatSettingsObj::SvNumberFormatSettingsObj( SvNumberFormatsSupplierObj& rParent, ::comphelper::SharedMutex _aMutex )
:m_xSupplier( &rParent )
- ,m_aMutex( _rMutex )
+ ,m_aMutex(std::move( _aMutex ))
{
}
diff --git a/svl/source/numbers/numfmuno.hxx b/svl/source/numbers/numfmuno.hxx
index fbd7889ce8cd..f88c2e6429af 100644
--- a/svl/source/numbers/numfmuno.hxx
+++ b/svl/source/numbers/numfmuno.hxx
@@ -90,7 +90,7 @@ private:
mutable ::comphelper::SharedMutex m_aMutex;
public:
- SvNumberFormatsObj(SvNumberFormatsSupplierObj& pParent, ::comphelper::SharedMutex const & _rMutex);
+ SvNumberFormatsObj(SvNumberFormatsSupplierObj& pParent, ::comphelper::SharedMutex _aMutex);
virtual ~SvNumberFormatsObj() override;
@@ -140,7 +140,7 @@ private:
mutable ::comphelper::SharedMutex m_aMutex;
public:
- SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, sal_uLong nK, const ::comphelper::SharedMutex& _rMutex );
+ SvNumberFormatObj( SvNumberFormatsSupplierObj& rParent, sal_uLong nK, ::comphelper::SharedMutex _aMutex );
virtual ~SvNumberFormatObj() override;
// XPropertySet
@@ -186,7 +186,7 @@ private:
mutable ::comphelper::SharedMutex m_aMutex;
public:
- SvNumberFormatSettingsObj( SvNumberFormatsSupplierObj& rParent, const ::comphelper::SharedMutex& _rMutex);
+ SvNumberFormatSettingsObj( SvNumberFormatsSupplierObj& rParent, ::comphelper::SharedMutex _aMutex);
virtual ~SvNumberFormatSettingsObj() override;
diff --git a/svl/source/numbers/supservs.cxx b/svl/source/numbers/supservs.cxx
index 165e67829feb..5a51158a2beb 100644
--- a/svl/source/numbers/supservs.cxx
+++ b/svl/source/numbers/supservs.cxx
@@ -27,6 +27,7 @@
#include <svl/numformat.hxx>
#include <tools/debug.hxx>
#include <osl/mutex.hxx>
+#include <utility>
#include <osl/diagnose.h>
using namespace ::com::sun::star::uno;
@@ -36,8 +37,8 @@ using namespace ::com::sun::star::util;
using namespace ::utl;
-SvNumberFormatsSupplierServiceObject::SvNumberFormatsSupplierServiceObject(const css::uno::Reference< css::uno::XComponentContext >& _rxORB)
- :m_xORB(_rxORB)
+SvNumberFormatsSupplierServiceObject::SvNumberFormatsSupplierServiceObject(css::uno::Reference< css::uno::XComponentContext > _xORB)
+ :m_xORB(std::move(_xORB))
{
}
diff --git a/svl/source/numbers/supservs.hxx b/svl/source/numbers/supservs.hxx
index 5baf8f055bc3..4ddf5751e84a 100644
--- a/svl/source/numbers/supservs.hxx
+++ b/svl/source/numbers/supservs.hxx
@@ -44,7 +44,7 @@ class SvNumberFormatsSupplierServiceObject final
void implEnsureFormatter();
public:
- explicit SvNumberFormatsSupplierServiceObject(const css::uno::Reference< css::uno::XComponentContext >& _rxORB);
+ explicit SvNumberFormatsSupplierServiceObject(css::uno::Reference< css::uno::XComponentContext > _xORB);
virtual ~SvNumberFormatsSupplierServiceObject() override;
// XInterface
diff --git a/svl/source/passwordcontainer/passwordcontainer.hxx b/svl/source/passwordcontainer/passwordcontainer.hxx
index 1f1d2569d4de..ca4b549f3b2d 100644
--- a/svl/source/passwordcontainer/passwordcontainer.hxx
+++ b/svl/source/passwordcontainer/passwordcontainer.hxx
@@ -19,6 +19,7 @@
#ifndef INCLUDED_SVL_SOURCE_PASSWORDCONTAINER_PASSWORDCONTAINER_HXX
#define INCLUDED_SVL_SOURCE_PASSWORDCONTAINER_PASSWORDCONTAINER_HXX
+#include <utility>
#include <vector>
#include <map>
#include <optional>
@@ -73,19 +74,19 @@ class NamePasswordRecord
public:
- NamePasswordRecord( const OUString& aName )
- : m_aName( aName )
+ NamePasswordRecord( OUString aName )
+ : m_aName(std::move( aName ))
, m_bHasMemoryPasswords( false )
, m_bHasPersistentPassword( false )
{
}
- NamePasswordRecord( const OUString& aName, const OUString& aPersistentList, const OUString& aPersistentIV )
- : m_aName( aName )
+ NamePasswordRecord( OUString aName, OUString aPersistentList, OUString aPersistentIV )
+ : m_aName(std::move( aName ))
, m_bHasMemoryPasswords( false )
, m_bHasPersistentPassword( true )
- , m_aPersistentPassword( aPersistentList )
- , m_aPersistentIV( aPersistentIV )
+ , m_aPersistentPassword(std::move( aPersistentList ))
+ , m_aPersistentIV(std::move( aPersistentIV ))
{
}
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index 773d17313cea..2424a9141a78 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -29,6 +29,7 @@
#include <unotools/datetime.hxx>
#include <memory>
+#include <utility>
#include <vector>
#include <limits.h>
#include <algorithm>
@@ -218,10 +219,10 @@ namespace svl::undo::impl
{
}
- NotifyUndoListener( UndoListenerStringMethod i_notificationMethod, const OUString& i_actionComment )
+ NotifyUndoListener( UndoListenerStringMethod i_notificationMethod, OUString i_actionComment )
:m_notificationMethod( nullptr )
,m_altNotificationMethod( i_notificationMethod )
- ,m_sActionComment( i_actionComment )
+ ,m_sActionComment(std::move( i_actionComment ))
{
}
@@ -1274,8 +1275,8 @@ struct SfxListUndoAction::Impl
OUString maComment;
OUString maRepeatComment;
- Impl( sal_uInt16 nId, ViewShellId nViewShellId, const OUString& rComment, const OUString& rRepeatComment ) :
- mnId(nId), mnViewShellId(nViewShellId), maComment(rComment), maRepeatComment(rRepeatComment) {}
+ Impl( sal_uInt16 nId, ViewShellId nViewShellId, OUString aComment, OUString aRepeatComment ) :
+ mnId(nId), mnViewShellId(nViewShellId), maComment(std::move(aComment)), maRepeatComment(std::move(aRepeatComment)) {}
};
sal_uInt16 SfxListUndoAction::GetId() const