include/sax/fastattribs.hxx                |    4 ++--
 sax/source/fastparser/fastparser.cxx       |    8 +++++---
 sax/source/fastparser/legacyfastparser.cxx |    3 ++-
 sax/source/tools/fastattribs.cxx           |    9 +++++----
 4 files changed, 14 insertions(+), 10 deletions(-)

New commits:
commit d203d3aeb29a46bd85eb320d4ebcd7325ec4a1ab
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri May 27 10:25:58 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri May 27 12:55:23 2022 +0200

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

diff --git a/include/sax/fastattribs.hxx b/include/sax/fastattribs.hxx
index 4ac958d882fc..57619b922518 100644
--- a/include/sax/fastattribs.hxx
+++ b/include/sax/fastattribs.hxx
@@ -43,8 +43,8 @@ struct UnknownAttribute
     OString maName;
     OString maValue;
 
-    UnknownAttribute( const OUString& rNamespaceURL, const OString& rName, 
const OString& value );
-    UnknownAttribute( const OString& rName, const OString& value );
+    UnknownAttribute( OUString sNamespaceURL, OString aName, OString value );
+    UnknownAttribute( OString sName, OString value );
 
     void FillAttribute( css::xml::Attribute* pAttrib ) const;
 };
diff --git a/sax/source/fastparser/fastparser.cxx 
b/sax/source/fastparser/fastparser.cxx
index 47f3da4a2ba6..250078bc5054 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -19,6 +19,7 @@
 
 #include <sax/fastparser.hxx>
 #include <sax/fastattribs.hxx>
+#include <utility>
 #include <xml2utf.hxx>
 
 #include <com/sun/star/io/XSeekable.hpp>
@@ -98,8 +99,8 @@ struct NameWithToken
     OUString msName;
     sal_Int32 mnToken;
 
-    NameWithToken(const OUString& sName, sal_Int32 nToken) :
-        msName(sName), mnToken(nToken) {}
+    NameWithToken(OUString sName, sal_Int32 nToken) :
+        msName(std::move(sName)), mnToken(nToken) {}
 };
 
 struct SaxContext
@@ -136,7 +137,8 @@ struct NamespaceDefine
     sal_Int32   mnToken;
     OUString    maNamespaceURL;
 
-    NamespaceDefine( const OString& rPrefix, sal_Int32 nToken, const OUString& 
rNamespaceURL ) : maPrefix( rPrefix ), mnToken( nToken ), maNamespaceURL( 
rNamespaceURL ) {}
+    NamespaceDefine( OString aPrefix, sal_Int32 nToken, OUString aNamespaceURL 
)
+        : maPrefix(std::move( aPrefix )), mnToken( nToken ), 
maNamespaceURL(std::move( aNamespaceURL )) {}
     NamespaceDefine() : mnToken(-1) {}
 };
 
diff --git a/sax/source/fastparser/legacyfastparser.cxx 
b/sax/source/fastparser/legacyfastparser.cxx
index d32b12d8a5f9..e4c425bd07d3 100644
--- a/sax/source/fastparser/legacyfastparser.cxx
+++ b/sax/source/fastparser/legacyfastparser.cxx
@@ -27,6 +27,7 @@
 #include <comphelper/processfactory.hxx>
 #include <rtl/ref.hxx>
 #include <memory>
+#include <utility>
 #include <vector>
 
 using namespace ::cppu;
@@ -46,7 +47,7 @@ private:
         OUString    m_aPrefix;
         OUString    m_aNamespaceURI;
 
-        NamespaceDefine( const OUString& rPrefix, const OUString& 
rNamespaceURI ) : m_aPrefix( rPrefix ), m_aNamespaceURI( rNamespaceURI ) {}
+        NamespaceDefine( OUString aPrefix, OUString aNamespaceURI ) : 
m_aPrefix(std::move( aPrefix )), m_aNamespaceURI(std::move( aNamespaceURI )) {}
     };
     std::vector< std::unique_ptr< NamespaceDefine > > m_aNamespaceDefines;
 
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx
index 1af7821cba24..9b309d5fb422 100644
--- a/sax/source/tools/fastattribs.cxx
+++ b/sax/source/tools/fastattribs.cxx
@@ -22,6 +22,7 @@
 #include <com/sun/star/xml/sax/SAXException.hpp>
 #include <rtl/math.h>
 #include <sax/fastattribs.hxx>
+#include <utility>
 
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::xml;
@@ -34,13 +35,13 @@ FastTokenHandlerBase::~FastTokenHandlerBase()
 {
 }
 
-UnknownAttribute::UnknownAttribute( const OUString& rNamespaceURL, const 
OString& rName, const OString& value )
-    : maNamespaceURL( rNamespaceURL ), maName( rName ), maValue( value )
+UnknownAttribute::UnknownAttribute( OUString aNamespaceURL, OString aName, 
OString value )
+    : maNamespaceURL(std::move( aNamespaceURL )), maName(std::move( aName )), 
maValue(std::move( value ))
 {
 }
 
-UnknownAttribute::UnknownAttribute( const OString& rName, const OString& value 
)
-    : maName( rName ), maValue( value )
+UnknownAttribute::UnknownAttribute( OString aName, OString value )
+    : maName(std::move( aName )), maValue(std::move( value ))
 {
 }
 

Reply via email to