From 36863a0e699b5a7cba346bca8a26e729be5a2f87 Mon Sep 17 00:00:00 2001 From: Jan Lingscheid Date: Tue, 12 Sep 2017 10:13:54 +0200 Subject: Remove remaining usage of GString in ui/tools/* --- src/ui/tools/rect-tool.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/ui/tools/rect-tool.cpp') diff --git a/src/ui/tools/rect-tool.cpp b/src/ui/tools/rect-tool.cpp index 9ebf51e76..c04f44877 100644 --- a/src/ui/tools/rect-tool.cpp +++ b/src/ui/tools/rect-tool.cpp @@ -397,8 +397,8 @@ void RectTool::drag(Geom::Point const pt, guint state) { Inkscape::Util::Quantity rdimx_q = Inkscape::Util::Quantity(rdimx, "px"); Inkscape::Util::Quantity rdimy_q = Inkscape::Util::Quantity(rdimy, "px"); - GString *xs = g_string_new(rdimx_q.string(desktop->namedview->display_units).c_str()); - GString *ys = g_string_new(rdimy_q.string(desktop->namedview->display_units).c_str()); + Glib::ustring xs = rdimx_q.string(desktop->namedview->display_units); + Glib::ustring ys = rdimy_q.string(desktop->namedview->display_units); if (state & GDK_CONTROL_MASK) { int ratio_x, ratio_y; @@ -421,20 +421,25 @@ void RectTool::drag(Geom::Point const pt, guint state) { } if (!is_golden_ratio) { - this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Rectangle: %s × %s (constrained to ratio %d:%d); with Shift to draw around the starting point"), xs->str, ys->str, ratio_x, ratio_y); + this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, + _("Rectangle: %s × %s (constrained to ratio %d:%d); with Shift to draw around the starting point"), + xs.c_str(), ys.c_str(), ratio_x, ratio_y); } else { if (ratio_y == 1) { - this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Rectangle: %s × %s (constrained to golden ratio 1.618 : 1); with Shift to draw around the starting point"), xs->str, ys->str); + this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, + _("Rectangle: %s × %s (constrained to golden ratio 1.618 : 1); with Shift to draw around the starting point"), + xs.c_str(), ys.c_str()); } else { - this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Rectangle: %s × %s (constrained to golden ratio 1 : 1.618); with Shift to draw around the starting point"), xs->str, ys->str); + this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, + _("Rectangle: %s × %s (constrained to golden ratio 1 : 1.618); with Shift to draw around the starting point"), + xs.c_str(), ys.c_str()); } } } else { - this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Rectangle: %s × %s; with Ctrl to make square or integer-ratio rectangle; with Shift to draw around the starting point"), xs->str, ys->str); + this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, + _("Rectangle: %s × %s; with Ctrl to make square or integer-ratio rectangle; with Shift to draw around the starting point"), + xs.c_str(), ys.c_str()); } - - g_string_free(xs, FALSE); - g_string_free(ys, FALSE); } void RectTool::finishItem() { -- cgit v1.2.3 From 6a03015b016c177e0657fc6274a571db16e48b64 Mon Sep 17 00:00:00 2001 From: Stefano Facchini Date: Sat, 23 Sep 2017 10:02:16 +0200 Subject: Remove unused parameter in SPItem::doWriteTransform --- src/ui/tools/rect-tool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/tools/rect-tool.cpp') diff --git a/src/ui/tools/rect-tool.cpp b/src/ui/tools/rect-tool.cpp index 9ebf51e76..0a116e8cd 100644 --- a/src/ui/tools/rect-tool.cpp +++ b/src/ui/tools/rect-tool.cpp @@ -447,7 +447,7 @@ void RectTool::finishItem() { } this->rect->updateRepr(); - this->rect->doWriteTransform(this->rect->getRepr(), this->rect->transform, NULL, true); + this->rect->doWriteTransform(this->rect->transform, NULL, true); this->desktop->canvas->endForcedFullRedraws(); -- cgit v1.2.3 From 525c6c0c7ea39c6bdb0013c546d08b6e94e51e61 Mon Sep 17 00:00:00 2001 From: Andrey Mozzhuhin Date: Fri, 6 Oct 2017 00:46:14 +0300 Subject: Rename get_group0_keyval to get_latin_keyval --- src/ui/tools/rect-tool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ui/tools/rect-tool.cpp') diff --git a/src/ui/tools/rect-tool.cpp b/src/ui/tools/rect-tool.cpp index 91725a00b..655650ef4 100644 --- a/src/ui/tools/rect-tool.cpp +++ b/src/ui/tools/rect-tool.cpp @@ -258,7 +258,7 @@ bool RectTool::root_handler(GdkEvent* event) { } break; case GDK_KEY_PRESS: - switch (get_group0_keyval (&event->key)) { + switch (get_latin_keyval (&event->key)) { case GDK_KEY_Alt_L: case GDK_KEY_Alt_R: case GDK_KEY_Control_L: @@ -326,7 +326,7 @@ bool RectTool::root_handler(GdkEvent* event) { } break; case GDK_KEY_RELEASE: - switch (get_group0_keyval (&event->key)) { + switch (get_latin_keyval (&event->key)) { case GDK_KEY_Alt_L: case GDK_KEY_Alt_R: case GDK_KEY_Control_L: -- cgit v1.2.3