summaryrefslogtreecommitdiffstats
path: root/src/rect-context.cpp
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-07-31 19:11:20 +0000
committerMarkus Engel <markus.engel@tum.de>2013-07-31 19:11:20 +0000
commit989abbac025a8b3349748d19a613a08586c5fdcd (patch)
tree157b5f656c6344784aea3c498fa60199bd7d2958 /src/rect-context.cpp
parentFurther refactoring of EventContexts. (diff)
downloadinkscape-989abbac025a8b3349748d19a613a08586c5fdcd.tar.gz
inkscape-989abbac025a8b3349748d19a613a08586c5fdcd.zip
Fixed SPObject ctor and dtor; removed singleton.h; some smaller changes.
(bzr r11608.1.110)
Diffstat (limited to 'src/rect-context.cpp')
-rw-r--r--src/rect-context.cpp20
1 files changed, 6 insertions, 14 deletions
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, _("<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->str, ys->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->str, ys->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->str, ys->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->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) {