summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-06-22 09:11:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-06-23 08:53:17 +0200
commit154cffd87ee4a21b5c0c291f84c95d74cde2a143 (patch)
tree5a3f976fc4bc5ddbc32dea98208d93d9a6085db7
parent07295115f5742e0d06a21d280610903ad55a75f0 (diff)
clang-tidy modernize-pass-by-value in libreofficekit
Change-Id: I1a6b4eb804a8cc4eb5e67ae4bbf8f31863f323d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136273 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx5
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx5
2 files changed, 6 insertions, 4 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
index dc106e58dcb4..22aadbe2f337 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
@@ -16,6 +16,7 @@
#include <boost/property_tree/ptree.hpp>
#include <o3tl/unreachable.hxx>
+#include <utility>
namespace {
@@ -26,9 +27,9 @@ struct GtvCalcHeaderBarPrivateImpl
{
int m_nSize;
std::string m_aText;
- Header(int nSize, const std::string& rText)
+ Header(int nSize, std::string aText)
: m_nSize(nSize),
- m_aText(rText)
+ m_aText(std::move(aText))
{ }
};
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 39f2281b0c7d..a092a1dbf1ab 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -11,6 +11,7 @@
#include <math.h>
#include <string.h>
#include <memory>
+#include <utility>
#include <vector>
#include <string>
#include <sstream>
@@ -358,9 +359,9 @@ struct CallbackData
std::string m_aPayload;
LOKDocView* m_pDocView;
- CallbackData(int nType, const std::string& rPayload, LOKDocView* pDocView)
+ CallbackData(int nType, std::string aPayload, LOKDocView* pDocView)
: m_nType(nType),
- m_aPayload(rPayload),
+ m_aPayload(std::move(aPayload)),
m_pDocView(pDocView) {}
};