summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/rect-tool.cpp
diff options
context:
space:
mode:
authorJan Lingscheid <jan.linscheid@auticon.de>2017-09-12 08:13:54 +0000
committerJan Lingscheid <jan.lingscheid@auticon.de>2017-09-21 05:46:25 +0000
commit36863a0e699b5a7cba346bca8a26e729be5a2f87 (patch)
treeaed4f939d2e0d5f6bd550fee0bb27f8dd719a285 /src/ui/tools/rect-tool.cpp
parentRemove unused GString in ui/tools/box3d-tool.cpp (diff)
downloadinkscape-36863a0e699b5a7cba346bca8a26e729be5a2f87.tar.gz
inkscape-36863a0e699b5a7cba346bca8a26e729be5a2f87.zip
Remove remaining usage of GString in ui/tools/*
Diffstat (limited to 'src/ui/tools/rect-tool.cpp')
-rw-r--r--src/ui/tools/rect-tool.cpp23
1 files changed, 14 insertions, 9 deletions
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, _("<b>Rectangle</b>: %s &#215; %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 &#215; %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 &#215; %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 &#215; %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 &#215; %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 &#215; %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 &#215; %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 &#215; %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() {