starmath/inc/cfgitem.hxx                  |    2 +-
 starmath/inc/mathml/export.hxx            |    5 +++--
 starmath/inc/mathml/import.hxx            |    5 +++--
 starmath/inc/mathml/mathmlMo.hxx          |    3 ++-
 starmath/inc/mathml/mathmlexport.hxx      |    5 +++--
 starmath/inc/mathml/mathmlimport.hxx      |    5 +++--
 starmath/inc/node.hxx                     |    2 +-
 starmath/inc/parsebase.hxx                |    3 ++-
 starmath/inc/token.hxx                    |   15 ++++++++-------
 starmath/source/ElementsDockingWindow.cxx |    1 +
 starmath/source/cfgitem.cxx               |    7 ++++---
 starmath/source/node.cxx                  |    5 +++--
 12 files changed, 34 insertions(+), 24 deletions(-)

New commits:
commit 057c60192aa34ae42f9f8abc2cb0ec93caa79130
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Aug 5 10:43:59 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Aug 5 15:56:52 2022 +0200

    clang-tidy modernize-pass-by-value in starmath
    
    Change-Id: Ib6bd1ed629980d4ff122114bc45396886c94ab78
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137842
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/starmath/inc/cfgitem.hxx b/starmath/inc/cfgitem.hxx
index 16c65fd7f58f..607f92d4e1b0 100644
--- a/starmath/inc/cfgitem.hxx
+++ b/starmath/inc/cfgitem.hxx
@@ -64,7 +64,7 @@ struct SmFntFmtListEntry
     OUString aId;
     SmFontFormat aFntFmt;
 
-    SmFntFmtListEntry(const OUString& rId, const SmFontFormat& rFntFmt);
+    SmFntFmtListEntry(OUString aId, SmFontFormat rFntFmt);
 };
 
 class SmFontFormatList
diff --git a/starmath/inc/mathml/export.hxx b/starmath/inc/mathml/export.hxx
index 0bd83e6ef238..12e541d31551 100644
--- a/starmath/inc/mathml/export.hxx
+++ b/starmath/inc/mathml/export.hxx
@@ -23,6 +23,7 @@
 #include "element.hxx"
 
 // Xml tools
+#include <utility>
 #include <xmloff/xmlnamespace.hxx>
 #include <xmloff/xmlexp.hxx>
 #include <xmloff/xmltoken.hxx>
@@ -76,8 +77,8 @@ public:
     void setUseExportTag(bool bUseExportTag) { m_bUseExportTag = 
bUseExportTag; }
 
 public:
-    explicit SmMLExportWrapper(css::uno::Reference<css::frame::XModel> const& 
rRef)
-        : m_xModel(rRef)
+    explicit SmMLExportWrapper(css::uno::Reference<css::frame::XModel> xRef)
+        : m_xModel(std::move(xRef))
         , m_bFlat(true)
         , m_bUseHTMLMLEntities(false)
         , m_pElementTree(nullptr)
diff --git a/starmath/inc/mathml/import.hxx b/starmath/inc/mathml/import.hxx
index d98cc8cf4b66..29bd01bf0ed0 100644
--- a/starmath/inc/mathml/import.hxx
+++ b/starmath/inc/mathml/import.hxx
@@ -13,6 +13,7 @@
 #include "element.hxx"
 
 // XML tools
+#include <utility>
 #include <vcl/errcode.hxx>
 #include <xmloff/xmlimp.hxx>
 
@@ -39,8 +40,8 @@ public:
 public:
     /** Constructor
      */
-    explicit SmMLImportWrapper(css::uno::Reference<css::frame::XModel> const& 
rRef)
-        : m_xModel(rRef)
+    explicit SmMLImportWrapper(css::uno::Reference<css::frame::XModel> xRef)
+        : m_xModel(std::move(xRef))
         , m_pDocShell(nullptr)
         , m_pMlImport(nullptr)
     {
diff --git a/starmath/inc/mathml/mathmlMo.hxx b/starmath/inc/mathml/mathmlMo.hxx
index 10a8b00014f5..e6457fd459c6 100644
--- a/starmath/inc/mathml/mathmlMo.hxx
+++ b/starmath/inc/mathml/mathmlMo.hxx
@@ -28,6 +28,7 @@
 
 #include <sal/types.h>
 #include <rtl/ustring.hxx>
+#include <utility>
 #include <vector>
 
 // https://www.w3.org/TR/MathML3/appendixc.html
@@ -69,7 +70,7 @@ struct moOperatorData
 
     moOperatorData(OUString motxt, moOpDF form, sal_uInt16 priority, 
sal_uInt16 lspace,
                    sal_uInt16 rspace, moOpDP properties)
-        : m_motxt(motxt)
+        : m_motxt(std::move(motxt))
         , m_form(form)
         , m_priority(priority)
         , m_lspace(lspace)
diff --git a/starmath/inc/mathml/mathmlexport.hxx 
b/starmath/inc/mathml/mathmlexport.hxx
index b7c054440c8a..28e35a7c52a0 100644
--- a/starmath/inc/mathml/mathmlexport.hxx
+++ b/starmath/inc/mathml/mathmlexport.hxx
@@ -19,6 +19,7 @@
 
 #pragma once
 
+#include <utility>
 #include <xmloff/xmlexp.hxx>
 #include <xmloff/xmltoken.hxx>
 
@@ -48,8 +49,8 @@ private:
     bool m_bUseHTMLMLEntities;
 
 public:
-    explicit SmXMLExportWrapper(css::uno::Reference<css::frame::XModel> const& 
rRef)
-        : xModel(rRef)
+    explicit SmXMLExportWrapper(css::uno::Reference<css::frame::XModel> xRef)
+        : xModel(std::move(xRef))
         , bFlat(true)
         , m_bUseHTMLMLEntities(false)
     {
diff --git a/starmath/inc/mathml/mathmlimport.hxx 
b/starmath/inc/mathml/mathmlimport.hxx
index 0a963a1b01d3..8e524f82b7a6 100644
--- a/starmath/inc/mathml/mathmlimport.hxx
+++ b/starmath/inc/mathml/mathmlimport.hxx
@@ -19,6 +19,7 @@
 
 #pragma once
 
+#include <utility>
 #include <xmloff/xmlimp.hxx>
 #include <vcl/errcode.hxx>
 
@@ -45,8 +46,8 @@ private:
     bool m_bUseHTMLMLEntities;
 
 public:
-    explicit SmXMLImportWrapper(css::uno::Reference<css::frame::XModel> const& 
rRef)
-        : xModel(rRef)
+    explicit SmXMLImportWrapper(css::uno::Reference<css::frame::XModel> xRef)
+        : xModel(std::move(xRef))
         , m_bUseHTMLMLEntities(false)
     {
     }
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 0a8a6c369065..69cc0a323ce9 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -140,7 +140,7 @@ class SmNode : public SmRect
     sal_Int32       mnAccIndex;
 
 protected:
-    SmNode(SmNodeType eNodeType, const SmToken &rNodeToken);
+    SmNode(SmNodeType eNodeType, SmToken aNodeToken);
 
 public:
     SmNode(const SmNode&) = delete;
diff --git a/starmath/inc/parsebase.hxx b/starmath/inc/parsebase.hxx
index ffa9b538a2b0..dd53ce631c11 100644
--- a/starmath/inc/parsebase.hxx
+++ b/starmath/inc/parsebase.hxx
@@ -28,6 +28,7 @@
 #include "node.hxx"
 
 #include <set>
+#include <utility>
 
 #define DEPTH_LIMIT 1024
 
@@ -61,7 +62,7 @@ struct SmErrorDesc
     SmErrorDesc(SmParseError eType, SmNode* pNode, OUString aText)
         : m_eType(eType)
         , m_pNode(pNode)
-        , m_aText(aText)
+        , m_aText(std::move(aText))
     {
     }
 };
diff --git a/starmath/inc/token.hxx b/starmath/inc/token.hxx
index d3e141e5adb9..df026efbf30e 100644
--- a/starmath/inc/token.hxx
+++ b/starmath/inc/token.hxx
@@ -34,6 +34,7 @@
 
 // std imports
 #include <memory>
+#include <utility>
 
 // TokenGroups
 enum class TG
@@ -182,15 +183,15 @@ struct SmColorTokenTableEntry
     {
     }
 
-    SmColorTokenTableEntry(const OUString& name, SmTokenType ctype, Color 
ncolor)
-        : aIdent(name)
+    SmColorTokenTableEntry(OUString name, SmTokenType ctype, Color ncolor)
+        : aIdent(std::move(name))
         , eType(ctype)
         , cColor(ncolor)
     {
     }
 
-    SmColorTokenTableEntry(const OUString& name, SmTokenType ctype, sal_uInt32 
ncolor)
-        : aIdent(name)
+    SmColorTokenTableEntry(OUString name, SmTokenType ctype, sal_uInt32 ncolor)
+        : aIdent(std::move(name))
         , eType(ctype)
         , cColor(ColorTransparency, ncolor)
     {
@@ -224,9 +225,9 @@ struct SmToken
     {
     }
 
-    SmToken(SmTokenType eTokenType, sal_Unicode cMath, const OUString& rText,
-            TG nTokenGroup = TG::NONE, sal_uInt16 nTokenLevel = 0)
-        : aText(rText)
+    SmToken(SmTokenType eTokenType, sal_Unicode cMath, OUString rText, TG 
nTokenGroup = TG::NONE,
+            sal_uInt16 nTokenLevel = 0)
+        : aText(std::move(rText))
         , eType(eTokenType)
         , cMathChar(cMath)
         , nGroup(nTokenGroup)
diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index b946cea28949..5d7b51de58a6 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -24,6 +24,7 @@
 #include <smmod.hxx>
 #include <cfgitem.hxx>
 #include <parse.hxx>
+#include <utility>
 #include <view.hxx>
 #include <visitors.hxx>
 #include <document.hxx>
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 7692aaa3ff5c..a8c0e5fcae38 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -22,6 +22,7 @@
 #include <svl/eitem.hxx>
 #include <svl/languageoptions.hxx>
 #include <unotools/configmgr.hxx>
+#include <utility>
 #include <vcl/outdev.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/settings.hxx>
@@ -218,9 +219,9 @@ bool SmFontFormat::operator == ( const SmFontFormat 
&rFntFmt ) const
 }
 
 
-SmFntFmtListEntry::SmFntFmtListEntry( const OUString &rId, const SmFontFormat 
&rFntFmt ) :
-    aId     (rId),
-    aFntFmt (rFntFmt)
+SmFntFmtListEntry::SmFntFmtListEntry( OUString _aId, SmFontFormat _aFntFmt ) :
+    aId     (std::move(_aId)),
+    aFntFmt (std::move(_aFntFmt))
 {
 }
 
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index c4c013b15725..008ea0d3cc7d 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -21,6 +21,7 @@
 #include <symbol.hxx>
 #include <smmod.hxx>
 #include "tmpdevice.hxx"
+#include <utility>
 #include <visitors.hxx>
 #include <vcl/metric.hxx>
 #include <osl/diagnose.h>
@@ -42,8 +43,8 @@ void ForEachNonNull(SmNode *pNode, F && f)
 
 }
 
-SmNode::SmNode(SmNodeType eNodeType, const SmToken &rNodeToken)
-    : maNodeToken( rNodeToken )
+SmNode::SmNode(SmNodeType eNodeType, SmToken aNodeToken)
+    : maNodeToken(std::move( aNodeToken ))
     , meType( eNodeType )
     , meScaleMode( SmScaleMode::None )
     , meRectHorAlign( RectHorAlign::Left )

Reply via email to