From 7654fc11a6442e6ee2a463d6dee6458c0f53768f Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Fri, 15 Jun 2018 00:45:10 +0200 Subject: =?UTF-8?q?Run=20clang-tidy=E2=80=99s=20modernize-use-override=20p?= =?UTF-8?q?ass.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds the override specifier on all methods which override a virtual method, whether they were already virtual or missing this specifier. --- src/ui/tool/transform-handle-set.cpp | 46 ++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/ui/tool/transform-handle-set.cpp') diff --git a/src/ui/tool/transform-handle-set.cpp b/src/ui/tool/transform-handle-set.cpp index 23cd6b79d..bb2e6c861 100644 --- a/src/ui/tool/transform-handle-set.cpp +++ b/src/ui/tool/transform-handle-set.cpp @@ -204,7 +204,7 @@ public: : TransformHandle(th, anchor, pb) {} protected: - virtual Glib::ustring _getTip(unsigned state) const { + Glib::ustring _getTip(unsigned state) const override { if (state_held_control(state)) { if (state_held_shift(state)) { return C_("Transform handle tip", @@ -225,12 +225,12 @@ protected: return C_("Transform handle tip", "Scale handle: drag to scale the selection"); } - virtual Glib::ustring _getDragTip(GdkEventMotion */*event*/) const { + Glib::ustring _getDragTip(GdkEventMotion */*event*/) const override { return format_tip(C_("Transform handle tip", "Scale by %.2f%% x %.2f%%"), _last_scale_x * 100, _last_scale_y * 100); } - virtual bool _hasDragTips() const { return true; } + bool _hasDragTips() const override { return true; } static double _last_scale_x, _last_scale_y; }; @@ -249,13 +249,13 @@ public: {} protected: - virtual void startTransform() { + void startTransform() override { _sc_center = _th.rotationCenter(); _sc_opposite = _th.bounds().corner(_corner + 2); _last_scale_x = _last_scale_y = 1.0; } - virtual Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) { + Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) override { Geom::Point scc = held_shift(*event) ? _sc_center : _sc_opposite; Geom::Point vold = _origin - scc, vnew = new_pos - scc; // avoid exploding the selection @@ -300,7 +300,7 @@ protected: return t; } - virtual CommitEvent getCommitEvent() { + CommitEvent getCommitEvent() override { return _last_transform.isUniformScale() ? COMMIT_MOUSE_SCALE_UNIFORM : COMMIT_MOUSE_SCALE; @@ -335,13 +335,13 @@ public: , _side(side) {} protected: - virtual void startTransform() { + void startTransform() override { _sc_center = _th.rotationCenter(); Geom::Rect b = _th.bounds(); _sc_opposite = Geom::middle_point(b.corner(_side + 2), b.corner(_side + 3)); _last_scale_x = _last_scale_y = 1.0; } - virtual Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) { + Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) override { Geom::Point scc = held_shift(*event) ? _sc_center : _sc_opposite; Geom::Point vs; Geom::Dim2 d1 = static_cast((_side + 1) % 2); @@ -386,7 +386,7 @@ protected: * Geom::Translate(scc); return t; } - virtual CommitEvent getCommitEvent() { + CommitEvent getCommitEvent() override { return _last_transform.isUniformScale() ? COMMIT_MOUSE_SCALE_UNIFORM : COMMIT_MOUSE_SCALE; @@ -415,13 +415,13 @@ public: {} protected: - virtual void startTransform() { + void startTransform() override { _rot_center = _th.rotationCenter(); _rot_opposite = _th.bounds().corner(_corner + 2); _last_angle = 0; } - virtual Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) + Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) override { Geom::Point rotc = held_shift(*event) ? _rot_opposite : _rot_center; double angle = Geom::angle_between(_origin - rotc, new_pos - rotc); @@ -446,9 +446,9 @@ protected: return t; } - virtual CommitEvent getCommitEvent() { return COMMIT_MOUSE_ROTATE; } + CommitEvent getCommitEvent() override { return COMMIT_MOUSE_ROTATE; } - virtual Glib::ustring _getTip(unsigned state) const { + Glib::ustring _getTip(unsigned state) const override { if (state_held_shift(state)) { if (state_held_control(state)) { return format_tip(C_("Transform handle tip", @@ -465,12 +465,12 @@ protected: "the selection around the rotation center"); } - virtual Glib::ustring _getDragTip(GdkEventMotion */*event*/) const { + Glib::ustring _getDragTip(GdkEventMotion */*event*/) const override { return format_tip(C_("Transform handle tip", "Rotate by %.2f°"), _last_angle * 180.0 / M_PI); } - virtual bool _hasDragTips() const { return true; } + bool _hasDragTips() const override { return true; } private: static Glib::RefPtr _corner_to_pixbuf(unsigned c) { @@ -498,7 +498,7 @@ public: protected: - virtual void startTransform() { + void startTransform() override { _skew_center = _th.rotationCenter(); Geom::Rect b = _th.bounds(); _skew_opposite = Geom::middle_point(b.corner(_side + 2), b.corner(_side + 3)); @@ -506,7 +506,7 @@ protected: _last_horizontal = _side % 2; } - virtual Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) + Geom::Affine computeTransform(Geom::Point const &new_pos, GdkEventMotion *event) override { Geom::Point scc = held_shift(*event) ? _skew_center : _skew_opposite; Geom::Dim2 d1 = static_cast((_side + 1) % 2); @@ -581,13 +581,13 @@ protected: return t; } - virtual CommitEvent getCommitEvent() { + CommitEvent getCommitEvent() override { return (_side % 2) ? COMMIT_MOUSE_SKEW_Y : COMMIT_MOUSE_SKEW_X; } - virtual Glib::ustring _getTip(unsigned state) const { + Glib::ustring _getTip(unsigned state) const override { if (state_held_shift(state)) { if (state_held_control(state)) { return format_tip(C_("Transform handle tip", @@ -605,7 +605,7 @@ protected: "the opposite handle"); } - virtual Glib::ustring _getDragTip(GdkEventMotion */*event*/) const { + Glib::ustring _getDragTip(GdkEventMotion */*event*/) const override { if (_last_horizontal) { return format_tip(C_("Transform handle tip", "Skew horizontally by %.2f°"), _last_angle * 360.0); @@ -615,7 +615,7 @@ protected: } } - virtual bool _hasDragTips() const { return true; } + bool _hasDragTips() const override { return true; } private: @@ -650,7 +650,7 @@ public: } protected: - virtual void dragged(Geom::Point &new_pos, GdkEventMotion *event) { + void dragged(Geom::Point &new_pos, GdkEventMotion *event) override { SnapManager &sm = _th._desktop->namedview->snap_manager; sm.setup(_th._desktop); bool snap = !held_shift(*event) && sm.someSnapperMightSnap(); @@ -667,7 +667,7 @@ protected: } sm.unSetup(); } - virtual Glib::ustring _getTip(unsigned /*state*/) const { + Glib::ustring _getTip(unsigned /*state*/) const override { return C_("Transform handle tip", "Rotation center: drag to change the origin of transforms"); } -- cgit v1.2.3