From 989abbac025a8b3349748d19a613a08586c5fdcd Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Wed, 31 Jul 2013 21:11:20 +0200 Subject: Fixed SPObject ctor and dtor; removed singleton.h; some smaller changes. (bzr r11608.1.110) --- src/rect-context.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src/rect-context.cpp') diff --git a/src/rect-context.cpp b/src/rect-context.cpp index 23c4794c1..2a3c8dd2b 100644 --- a/src/rect-context.cpp +++ b/src/rect-context.cpp @@ -64,8 +64,6 @@ const std::string& SPRectContext::getPrefsPath() { const std::string SPRectContext::prefsPath = "/tools/shapes/rect"; SPRectContext::SPRectContext() : SPEventContext() { - this->_message_context = 0; - this->cursor_shape = cursor_rect_xpm; this->hot_x = 4; this->hot_y = 4; @@ -102,10 +100,6 @@ SPRectContext::~SPRectContext() { if (this->rect) { this->finishItem(); } - - if (this->_message_context) { - delete this->_message_context; - } } /** @@ -143,8 +137,6 @@ void SPRectContext::setup() { if (prefs->getBool("/tools/shapes/gradientdrag")) { this->enableGrDrag(); } - - this->_message_context = new Inkscape::MessageContext(this->desktop->messageStack()); } void SPRectContext::set(const Inkscape::Preferences::Entry& val) { @@ -396,7 +388,7 @@ void SPRectContext::drag(Geom::Point const pt, guint state) { SPDesktop *desktop = this->desktop; if (!this->rect) { - if (Inkscape::have_viable_layer(desktop, this->_message_context) == false) { + if (Inkscape::have_viable_layer(desktop, this->message_context) == false) { return; } @@ -459,16 +451,16 @@ void SPRectContext::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->str, ys->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->str, ys->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->str, ys->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->str, ys->str); } g_string_free(xs, FALSE); @@ -476,7 +468,7 @@ void SPRectContext::drag(Geom::Point const pt, guint state) { } void SPRectContext::finishItem() { - this->_message_context->clear(); + this->message_context->clear(); if (this->rect != NULL) { if (this->rect->width.computed == 0 || this->rect->height.computed == 0) { -- cgit v1.2.3