diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2019-08-22 17:12:30 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2019-08-23 08:08:45 +0000 |
| commit | a20b38f42bae02da47b7cd668320b08653d7daa6 (patch) | |
| tree | 1939bbbcd000246bed368202de0648b39a37395c /src/ui/tool/node.cpp | |
| parent | remove HAVE_POTRACE (diff) | |
| download | inkscape-a20b38f42bae02da47b7cd668320b08653d7daa6.tar.gz inkscape-a20b38f42bae02da47b7cd668320b08653d7daa6.zip | |
Eliminate clang warnings
-Wconstant-conversion
-Wenum-compare-switch
-Wpointer-bool-conversion
-Wundefined-bool-conversion
-Wunused-value
Excluding deprecation warnings and 3rdparty directory.
Diffstat (limited to '')
| -rw-r--r-- | src/ui/tool/node.cpp | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index e1b63370c..addc0759c 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -264,26 +264,23 @@ void Handle::setDirection(Geom::Point const &dir) setRelativePos(unitdir * length()); } +/** + * See also: Node::node_type_to_localized_string(NodeType type) + */ char const *Handle::handle_type_to_localized_string(NodeType type) { - char const *s = ""; - switch(type) { case NODE_CUSP: - s = _("Corner node handle"); - break; + return _("Corner node handle"); case NODE_SMOOTH: - s = _("Smooth node handle"); - break; + return _("Smooth node handle"); case NODE_SYMMETRIC: - s = _("Symmetric node handle"); - break; + return _("Symmetric node handle"); case NODE_AUTO: - s = _("Auto-smooth node handle"); - break; + return _("Auto-smooth node handle"); + default: + return ""; } - - return (s); } bool Handle::_eventHandler(Inkscape::UI::Tools::ToolBase *event_context, GdkEvent *event) @@ -1627,26 +1624,23 @@ Glib::ustring Node::_getDragTip(GdkEventMotion */*event*/) const return ret; } +/** + * See also: Handle::handle_type_to_localized_string(NodeType type) + */ char const *Node::node_type_to_localized_string(NodeType type) { - char const *s = ""; - switch (type) { case NODE_CUSP: - s = _("Corner node"); - break; + return _("Corner node"); case NODE_SMOOTH: - s = _("Smooth node"); - break; + return _("Smooth node"); case NODE_SYMMETRIC: - s = _("Symmetric node"); - break; + return _("Symmetric node"); case NODE_AUTO: - s = _("Auto-smooth node"); - break; + return _("Auto-smooth node"); + default: + return ""; } - - return (s); } bool Node::_is_line_segment(Node *first, Node *second) |
