include/linguistic/hyphdta.hxx  |    4 ++--
 include/linguistic/spelldta.hxx |    2 +-
 linguistic/source/convdic.cxx   |    5 +++--
 linguistic/source/convdic.hxx   |    2 +-
 linguistic/source/dicimp.cxx    |   13 +++++++------
 linguistic/source/dicimp.hxx    |    6 +++---
 linguistic/source/dlistimp.cxx  |    7 ++++---
 linguistic/source/hyphdta.cxx   |    9 +++++----
 linguistic/source/lngsvcmgr.cxx |   11 ++++++-----
 linguistic/source/spelldta.cxx  |    5 +++--
 10 files changed, 35 insertions(+), 29 deletions(-)

New commits:
commit 825aeb04e6c45d0ba8ef1bd08e7ade297e9f5361
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed May 18 15:00:35 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed May 18 20:56:00 2022 +0200

    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.gran...@collabora.co.uk>

diff --git a/include/linguistic/hyphdta.hxx b/include/linguistic/hyphdta.hxx
index a346b75b15b3..48030b571705 100644
--- a/include/linguistic/hyphdta.hxx
+++ b/include/linguistic/hyphdta.hxx
@@ -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;
 
diff --git a/include/linguistic/spelldta.hxx b/include/linguistic/spelldta.hxx
index 8ed336961663..d0057ffbd426 100644
--- a/include/linguistic/spelldta.hxx
+++ b/include/linguistic/spelldta.hxx
@@ -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;
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx
index 8d0f5bf50d26..d2fb118b5759 100644
--- a/linguistic/source/convdic.cxx
+++ b/linguistic/source/convdic.cxx
@@ -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),
diff --git a/linguistic/source/convdic.hxx b/linguistic/source/convdic.hxx
index ba914d3a9779..e5f1d4bea69a 100644
--- a/linguistic/source/convdic.hxx
+++ b/linguistic/source/convdic.hxx
@@ -82,7 +82,7 @@ protected:
     void    Save();
 
 public:
-    ConvDic( const OUString &rName,
+    ConvDic( OUString aName,
              LanguageType nLanguage,
              sal_Int16 nConversionType,
              bool bBiDirectional,
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index 7eb18d64c635..af83c96ff71d 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -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)
 {
 }
diff --git a/linguistic/source/dicimp.hxx b/linguistic/source/dicimp.hxx
index cec1e1866ed3..c94094de6571 100644
--- a/linguistic/source/dicimp.hxx
+++ b/linguistic/source/dicimp.hxx
@@ -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
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 2901273c3e30..281abce9e11a 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -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)
 {
 }
diff --git a/linguistic/source/hyphdta.cxx b/linguistic/source/hyphdta.cxx
index 3ab4552171fa..4d2a88266c07 100644
--- a/linguistic/source/hyphdta.cxx
+++ b/linguistic/source/hyphdta.cxx
@@ -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)
 {
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index e385c3b2421c..f38ee262099c 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -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())
     {
diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx
index b3f57e9b870f..6aa99f8b70f6 100644
--- a/linguistic/source/spelldta.cxx
+++ b/linguistic/source/spelldta.cxx
@@ -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)
 {

Reply via email to