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

Change-Id: Ia5fc81ed6e6e060d62e5ff42dccb06e36774a65c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134534
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2022-05-18 20:56:00 +02:00
parent 6b12ba07be
commit 825aeb04e6
10 changed files with 35 additions and 29 deletions
+2 -2
View File
@@ -83,8 +83,8 @@ class PossibleHyphens final :
PossibleHyphens & operator = (const PossibleHyphens &) = delete;
public:
PossibleHyphens(const OUString &rWord, LanguageType nLang,
const OUString &rHyphWord,
PossibleHyphens(OUString aWord, LanguageType nLang,
OUString aHyphWord,
const css::uno::Sequence< sal_Int16 > &rPositions);
virtual ~PossibleHyphens() override;
+1 -1
View File
@@ -63,7 +63,7 @@ class SpellAlternatives final
public:
UNLESS_MERGELIBS(LNG_DLLPUBLIC) SpellAlternatives();
SpellAlternatives(const OUString &rWord, LanguageType nLang,
SpellAlternatives(OUString aWord, LanguageType nLang,
const css::uno::Sequence< OUString > &rAlternatives );
virtual ~SpellAlternatives() override;
SpellAlternatives(const SpellAlternatives&) = delete;
+3 -2
View File
@@ -51,6 +51,7 @@
#include "convdic.hxx"
#include "convdicxml.hxx"
#include <linguistic/misc.hxx>
#include <utility>
using namespace utl;
using namespace osl;
@@ -142,13 +143,13 @@ bool IsConvDic( const OUString &rFileURL, LanguageType &nLang, sal_Int16 &nConvT
ConvDic::ConvDic(
const OUString &rName,
OUString aName_,
LanguageType nLang,
sal_Int16 nConvType,
bool bBiDirectional,
const OUString &rMainURL) :
aFlushListeners( GetLinguMutex() ),
aMainURL(rMainURL), aName(rName), nLanguage(nLang),
aMainURL(rMainURL), aName(std::move(aName_)), nLanguage(nLang),
nConversionType(nConvType),
nMaxLeftCharCount(0), nMaxRightCharCount(0),
bMaxCharCountIsValid(true),
+1 -1
View File
@@ -82,7 +82,7 @@ protected:
void Save();
public:
ConvDic( const OUString &rName,
ConvDic( OUString aName,
LanguageType nLanguage,
sal_Int16 nConversionType,
bool bBiDirectional,
+7 -6
View File
@@ -43,6 +43,7 @@
#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
#include <algorithm>
#include <utility>
using namespace utl;
@@ -213,12 +214,12 @@ sal_Int16 ReadDicVersion( SvStream& rStream, LanguageType &nLng, bool &bNeg, OUS
return nDicVersion;
}
DictionaryNeo::DictionaryNeo(const OUString &rName,
DictionaryNeo::DictionaryNeo(OUString aName,
LanguageType nLang, DictionaryType eType,
const OUString &rMainURL,
bool bWriteable) :
aDicEvtListeners( GetLinguMutex() ),
aDicName (rName),
aDicName (std::move(aName)),
aMainURL (rMainURL),
eDicType (eType),
nLanguage (nLang)
@@ -1036,10 +1037,10 @@ DicEntry::DicEntry(const OUString &rDicFileWord,
bIsNegativ = bIsNegativWord;
}
DicEntry::DicEntry(const OUString &rDicWord, bool bNegativ,
const OUString &rRplcText) :
aDicWord (rDicWord),
aReplacement (rRplcText),
DicEntry::DicEntry(OUString aDicWord_, bool bNegativ,
OUString aRplcText_) :
aDicWord (std::move(aDicWord_)),
aReplacement (std::move(aRplcText_)),
bIsNegativ (bNegativ)
{
}
+3 -3
View File
@@ -74,7 +74,7 @@ class DictionaryNeo :
bool bIsLoadEntries = false);
public:
DictionaryNeo(const OUString &rName, LanguageType nLang,
DictionaryNeo(OUString aName, LanguageType nLang,
css::linguistic2::DictionaryType eType,
const OUString &rMainURL,
bool bWriteable );
@@ -155,8 +155,8 @@ class DicEntry :
public:
DicEntry(const OUString &rDicFileWord, bool bIsNegativ);
DicEntry(const OUString &rDicWord, bool bIsNegativ,
const OUString &rRplcText);
DicEntry(OUString aDicWord, bool bIsNegativ,
OUString aRplcText);
virtual ~DicEntry() override;
// XDictionaryEntry
+4 -3
View File
@@ -39,6 +39,7 @@
#include <unotools/resmgr.hxx>
#include <unotools/charclass.hxx>
#include <sal/log.hxx>
#include <utility>
#include "dlistimp.hxx"
#include "dicimp.hxx"
@@ -72,7 +73,7 @@ class DicEvtListenerHelper :
sal_Int16 nNumCollectEvtListeners;
public:
explicit DicEvtListenerHelper( const uno::Reference< XDictionaryList > &rxDicList );
explicit DicEvtListenerHelper( uno::Reference< XDictionaryList > xDicList );
virtual ~DicEvtListenerHelper() override;
// XEventListener
@@ -98,9 +99,9 @@ public:
DicEvtListenerHelper::DicEvtListenerHelper(
const uno::Reference< XDictionaryList > &rxDicList ) :
uno::Reference< XDictionaryList > xDicList ) :
aDicListEvtListeners ( GetLinguMutex() ),
xMyDicList ( rxDicList ),
xMyDicList (std::move( xDicList )),
nCondensedEvt(0), nNumCollectEvtListeners(0)
{
}
+5 -4
View File
@@ -25,6 +25,7 @@
#include <tools/debug.hxx>
#include <unotools/localedatawrapper.hxx>
#include <utility>
using namespace osl;
using namespace com::sun::star;
@@ -110,11 +111,11 @@ sal_Bool SAL_CALL HyphenatedWord::isAlternativeSpelling()
}
PossibleHyphens::PossibleHyphens(const OUString &rWord, LanguageType nLang,
const OUString &rHyphWord,
PossibleHyphens::PossibleHyphens(OUString aWord_, LanguageType nLang,
OUString aHyphWord,
const Sequence< sal_Int16 > &rPositions) :
aWord (rWord),
aWordWithHyphens(rHyphWord),
aWord (std::move(aWord_)),
aWordWithHyphens(std::move(aHyphWord)),
aOrigHyphenPos (rPositions),
nLanguage (nLang)
{
+6 -5
View File
@@ -33,6 +33,7 @@
#include <tools/debug.hxx>
#include <unotools/lingucfg.hxx>
#include <utility>
#include <vcl/svapp.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <comphelper/processfactory.hxx>
@@ -131,9 +132,9 @@ struct SvcInfo
const OUString aSvcImplName;
const std::vector< LanguageType > aSuppLanguages;
SvcInfo( const OUString &rSvcImplName,
SvcInfo( OUString aSvcImplName_,
std::vector< LanguageType >&& rSuppLanguages ) :
aSvcImplName (rSvcImplName),
aSvcImplName (std::move(aSvcImplName_)),
aSuppLanguages (std::move(rSuppLanguages))
{
}
@@ -173,7 +174,7 @@ class LngSvcMgrListenerHelper :
public:
LngSvcMgrListenerHelper( LngSvcMgr &rLngSvcMgr,
const uno::Reference< linguistic2::XSearchableDictionaryList > &rxDicList );
uno::Reference< linguistic2::XSearchableDictionaryList > xDicList );
LngSvcMgrListenerHelper(const LngSvcMgrListenerHelper&) = delete;
LngSvcMgrListenerHelper& operator=(const LngSvcMgrListenerHelper&) = delete;
@@ -207,11 +208,11 @@ public:
LngSvcMgrListenerHelper::LngSvcMgrListenerHelper(
LngSvcMgr &rLngSvcMgr,
const uno::Reference< linguistic2::XSearchableDictionaryList > &rxDicList ) :
uno::Reference< linguistic2::XSearchableDictionaryList > xDicList_ ) :
rMyManager ( rLngSvcMgr ),
aLngSvcMgrListeners ( GetLinguMutex() ),
aLngSvcEvtBroadcasters ( GetLinguMutex() ),
xDicList ( rxDicList )
xDicList (std::move( xDicList_ ))
{
if (xDicList.is())
{
+3 -2
View File
@@ -24,6 +24,7 @@
#include <i18nlangtag/languagetag.hxx>
#include <algorithm>
#include <utility>
#include <vector>
#include <linguistic/misc.hxx>
@@ -167,10 +168,10 @@ SpellAlternatives::SpellAlternatives()
SpellAlternatives::SpellAlternatives(
const OUString &rWord, LanguageType nLang,
OUString aWord_, LanguageType nLang,
const Sequence< OUString > &rAlternatives ) :
aAlt (rAlternatives),
aWord (rWord),
aWord (std::move(aWord_)),
nType (SpellFailure::IS_NEGATIVE_WORD),
nLanguage (nLang)
{