summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-18 16:54:54 +0000
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-18 18:27:11 +0000
commit571f36f1b61d316a2f2ace00fa94ba83ab1ac0a0 (patch)
tree95696a57d31908e2d5b5853b4c84e3d53c700db1 /src/ui/dialog
parentUpdate pdf-parser.cpp (diff)
downloadinkscape-571f36f1b61d316a2f2ace00fa94ba83ab1ac0a0.tar.gz
inkscape-571f36f1b61d316a2f2ace00fa94ba83ab1ac0a0.zip
Run clang-tidy’s modernize-pass-by-value pass.
This avoids having to pass variables by reference before copying them when calling a constructor.
Diffstat (limited to 'src/ui/dialog')
-rw-r--r--src/ui/dialog/align-and-distribute.cpp6
-rw-r--r--src/ui/dialog/align-and-distribute.h2
-rw-r--r--src/ui/dialog/dialog.cpp6
-rw-r--r--src/ui/dialog/dialog.h2
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp8
-rw-r--r--src/ui/dialog/pixelartdialog.cpp4
-rw-r--r--src/ui/dialog/styledialog.cpp3
7 files changed, 20 insertions, 11 deletions
diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp
index 02893d5e1..ad69bb59c 100644
--- a/src/ui/dialog/align-and-distribute.cpp
+++ b/src/ui/dialog/align-and-distribute.cpp
@@ -25,6 +25,8 @@
#include <2geom/transforms.h>
+#include <utility>
+
#include "align-and-distribute.h"
#include "desktop.h"
@@ -56,13 +58,13 @@ namespace Dialog {
/////////helper classes//////////////////////////////////
-Action::Action(const Glib::ustring &id,
+Action::Action(Glib::ustring id,
const Glib::ustring &tiptext,
guint row, guint column,
Gtk::Grid &parent,
AlignAndDistribute &dialog):
_dialog(dialog),
- _id(id),
+ _id(std::move(id)),
_parent(parent)
{
Gtk::Image* pIcon = Gtk::manage(new Gtk::Image());
diff --git a/src/ui/dialog/align-and-distribute.h b/src/ui/dialog/align-and-distribute.h
index f8099908d..53b8c1a0f 100644
--- a/src/ui/dialog/align-and-distribute.h
+++ b/src/ui/dialog/align-and-distribute.h
@@ -139,7 +139,7 @@ public :
enum AlignTarget { LAST=0, FIRST, BIGGEST, SMALLEST, PAGE, DRAWING, SELECTION };
enum AlignTargetNode { LAST_NODE=0, FIRST_NODE, MID_NODE, MIN_NODE, MAX_NODE };
- Action(const Glib::ustring &id,
+ Action(Glib::ustring id,
const Glib::ustring &tiptext,
guint row, guint column,
Gtk::Grid &parent,
diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp
index 0cee7f1d6..a5037bbbf 100644
--- a/src/ui/dialog/dialog.cpp
+++ b/src/ui/dialog/dialog.cpp
@@ -22,6 +22,8 @@
#include <gdk/gdkkeysyms.h>
+#include <utility>
+
#include "inkscape.h"
#include "ui/monitor.h"
#include "ui/tools/tool-base.h"
@@ -49,14 +51,14 @@ gboolean sp_retransientize_again(gpointer dlgPtr)
//=====================================================================
Dialog::Dialog(Behavior::BehaviorFactory behavior_factory, const char *prefs_path, int verb_num,
- Glib::ustring const &apply_label)
+ Glib::ustring apply_label)
: _user_hidden(false),
_hiddenF12(false),
retransientize_suppress(false),
_prefs_path(prefs_path),
_verb_num(verb_num),
_title(),
- _apply_label(apply_label),
+ _apply_label(std::move(apply_label)),
_desktop(nullptr),
_is_active_desktop(true),
_behavior(nullptr)
diff --git a/src/ui/dialog/dialog.h b/src/ui/dialog/dialog.h
index 8f94c544b..c0f0a53bd 100644
--- a/src/ui/dialog/dialog.h
+++ b/src/ui/dialog/dialog.h
@@ -64,7 +64,7 @@ public:
* @param verb_num the dialog verb.
*/
Dialog(Behavior::BehaviorFactory behavior_factory, const char *prefs_path = nullptr,
- int verb_num = 0, Glib::ustring const &apply_label = "");
+ int verb_num = 0, Glib::ustring apply_label = "");
virtual ~Dialog();
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index db930fe8e..20ce89115 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -38,6 +38,8 @@
#include <glibmm/main.h>
#include <glibmm/convert.h>
+#include <utility>
+
#include "desktop.h"
#include "dialog-manager.h"
#include "document-undo.h"
@@ -100,11 +102,11 @@ class CheckButtonAttr : public Gtk::CheckButton, public AttrWidget
{
public:
CheckButtonAttr(bool def, const Glib::ustring& label,
- const Glib::ustring& tv, const Glib::ustring& fv,
+ Glib::ustring tv, Glib::ustring fv,
const SPAttributeEnum a, char* tip_text)
: Gtk::CheckButton(label),
AttrWidget(a, def),
- _true_val(tv), _false_val(fv)
+ _true_val(std::move(tv)), _false_val(std::move(fv))
{
signal_toggled().connect(signal_attr_changed().make_slot());
if (tip_text) {
@@ -736,7 +738,7 @@ public:
typedef sigc::slot<void, const AttrWidget*> SetAttrSlot;
Settings(FilterEffectsDialog& d, Gtk::Box& b, SetAttrSlot slot, const int maxtypes)
- : _dialog(d), _set_attr_slot(slot), _current_type(-1), _max_types(maxtypes)
+ : _dialog(d), _set_attr_slot(std::move(slot)), _current_type(-1), _max_types(maxtypes)
{
_groups.resize(_max_types);
_attrwidgets.resize(_max_types);
diff --git a/src/ui/dialog/pixelartdialog.cpp b/src/ui/dialog/pixelartdialog.cpp
index 198737eb8..2c1201db4 100644
--- a/src/ui/dialog/pixelartdialog.cpp
+++ b/src/ui/dialog/pixelartdialog.cpp
@@ -53,6 +53,8 @@
#ifdef HAVE_OPENMP
#include <omp.h>
+
+#include <utility>
#endif // HAVE_OPENMP
namespace Inkscape {
@@ -79,7 +81,7 @@ private:
struct Output
{
Output(Tracer::Splines splines, SVGLength x, SVGLength y) :
- splines(splines), x(x), y(y)
+ splines(std::move(splines)), x(x), y(y)
{}
Tracer::Splines splines;
diff --git a/src/ui/dialog/styledialog.cpp b/src/ui/dialog/styledialog.cpp
index db284466d..9171dd9ce 100644
--- a/src/ui/dialog/styledialog.cpp
+++ b/src/ui/dialog/styledialog.cpp
@@ -28,6 +28,7 @@
#include <glibmm/regex.h>
#include <map>
+#include <utility>
//#define DEBUG_STYLEDIALOG
@@ -1045,7 +1046,7 @@ class PropertyData
{
public:
PropertyData() = default;;
- PropertyData(Glib::ustring name) : _name(name) {};
+ PropertyData(Glib::ustring name) : _name(std::move(name)) {};
void _setSheetValue(Glib::ustring value) { _sheetValue = value; };
void _setAttrValue(Glib::ustring value) { _attrValue = value; };