summaryrefslogtreecommitdiffstats
path: root/src/lpe-tool-context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lpe-tool-context.cpp')
-rw-r--r--src/lpe-tool-context.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lpe-tool-context.cpp b/src/lpe-tool-context.cpp
index edc9a6930..bf912746e 100644
--- a/src/lpe-tool-context.cpp
+++ b/src/lpe-tool-context.cpp
@@ -191,8 +191,7 @@ bool SPLPEToolContext::root_handler(GdkEvent* event) {
if (sp_pen_context_has_waiting_LPE(this)) {
// quit when we are waiting for a LPE to be applied
//ret = ((SPEventContextClass *) sp_lpetool_context_parent_class)->root_handler(event_context, event);
- ret = this->root_handler(event);
- return ret;
+ return SPPenContext::root_handler(event);
}
switch (event->type) {
@@ -224,7 +223,7 @@ bool SPLPEToolContext::root_handler(GdkEvent* event) {
// we pass the mouse click on to pen tool as the first click which it should collect
//ret = ((SPEventContextClass *) sp_lpetool_context_parent_class)->root_handler(event_context, event);
- ret = this->root_handler(event);
+ ret = SPPenContext::root_handler(event);
}
break;
@@ -416,7 +415,7 @@ lpetool_create_measuring_items(SPLPEToolContext *lc, Inkscape::Selection *select
if (!show)
sp_canvas_item_hide(SP_CANVAS_ITEM(canvas_text));
- Inkscape::Util::Unit unit;
+ Inkscape::Util::Unit const * unit = NULL;
if (prefs->getString("/tools/lpetool/unit").compare("")) {
unit = unit_table.getUnit(prefs->getString("/tools/lpetool/unit"));
} else {
@@ -425,7 +424,7 @@ lpetool_create_measuring_items(SPLPEToolContext *lc, Inkscape::Selection *select
lengthval = Geom::length(pwd2);
lengthval = Inkscape::Util::Quantity::convert(lengthval, "px", unit);
- arc_length = g_strdup_printf("%.2f %s", lengthval, unit.abbr.c_str());
+ arc_length = g_strdup_printf("%.2f %s", lengthval, unit->abbr.c_str());
sp_canvastext_set_text (canvas_text, arc_length);
set_pos_and_anchor(canvas_text, pwd2, 0.5, 10);
// TODO: must we free arc_length?
@@ -455,7 +454,7 @@ lpetool_update_measuring_items(SPLPEToolContext *lc)
SPPath *path = i->first;
SPCurve *curve = path->getCurve();
Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2 = Geom::paths_to_pw(curve->get_pathvector());
- Inkscape::Util::Unit unit;
+ Inkscape::Util::Unit const * unit = NULL;
if (prefs->getString("/tools/lpetool/unit").compare("")) {
unit = unit_table.getUnit(prefs->getString("/tools/lpetool/unit"));
} else {
@@ -463,7 +462,7 @@ lpetool_update_measuring_items(SPLPEToolContext *lc)
}
double lengthval = Geom::length(pwd2);
lengthval = Inkscape::Util::Quantity::convert(lengthval, "px", unit);
- gchar *arc_length = g_strdup_printf("%.2f %s", lengthval, unit.abbr.c_str());
+ gchar *arc_length = g_strdup_printf("%.2f %s", lengthval, unit->abbr.c_str());
sp_canvastext_set_text (SP_CANVASTEXT(i->second), arc_length);
set_pos_and_anchor(SP_CANVASTEXT(i->second), pwd2, 0.5, 10);
// TODO: must we free arc_length?