diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2017-09-27 08:15:49 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2017-09-27 08:15:49 +0000 |
| commit | 40d24d185b7e050deac650960464630f9af4b073 (patch) | |
| tree | ec019942c30f0ae0ee010a86c2fdc6f04af713c2 /src/ui/tools/rect-tool.cpp | |
| parent | Fix error when vertical text has 'text-orientation' value 'sideways'. (diff) | |
| parent | Remove usage of GString in sp-object.cpp (diff) | |
| download | inkscape-40d24d185b7e050deac650960464630f9af4b073.tar.gz inkscape-40d24d185b7e050deac650960464630f9af4b073.zip | |
Merge branch 'jali/inkscape-ustring_refactor'
Removes usage of GString.
Diffstat (limited to 'src/ui/tools/rect-tool.cpp')
| -rw-r--r-- | src/ui/tools/rect-tool.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/ui/tools/rect-tool.cpp b/src/ui/tools/rect-tool.cpp index 0a116e8cd..91725a00b 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, _("<b>Rectangle</b>: %s × %s (constrained to ratio %d:%d); with <b>Shift</b> to draw around the starting point"), xs->str, ys->str, ratio_x, ratio_y); + this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, + _("<b>Rectangle</b>: %s × %s (constrained to ratio %d:%d); with <b>Shift</b> 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, _("<b>Rectangle</b>: %s × %s (constrained to golden ratio 1.618 : 1); with <b>Shift</b> to draw around the starting point"), xs->str, ys->str); + this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, + _("<b>Rectangle</b>: %s × %s (constrained to golden ratio 1.618 : 1); with <b>Shift</b> to draw around the starting point"), + xs.c_str(), ys.c_str()); } else { - this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("<b>Rectangle</b>: %s × %s (constrained to golden ratio 1 : 1.618); with <b>Shift</b> to draw around the starting point"), xs->str, ys->str); + this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, + _("<b>Rectangle</b>: %s × %s (constrained to golden ratio 1 : 1.618); with <b>Shift</b> to draw around the starting point"), + xs.c_str(), ys.c_str()); } } } else { - this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("<b>Rectangle</b>: %s × %s; with <b>Ctrl</b> to make square or integer-ratio rectangle; with <b>Shift</b> to draw around the starting point"), xs->str, ys->str); + this->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, + _("<b>Rectangle</b>: %s × %s; with <b>Ctrl</b> to make square or integer-ratio rectangle; with <b>Shift</b> 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() { |
