From aa042e930bc5cce596829086ce84f2c3c7c885ad Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 17 Jun 2012 00:08:03 -0700 Subject: Removed outdated classes. Pruned header to not introduce extraneous includes. (bzr r11502) --- src/live_effects/parameter/unit.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/live_effects/parameter/unit.cpp') diff --git a/src/live_effects/parameter/unit.cpp b/src/live_effects/parameter/unit.cpp index 2f2d71679..a885577e7 100644 --- a/src/live_effects/parameter/unit.cpp +++ b/src/live_effects/parameter/unit.cpp @@ -6,6 +6,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include + #include "live_effects/parameter/unit.h" #include "live_effects/effect.h" #include "ui/widget/registered-widget.h" -- cgit v1.2.3 From 971ef4214070c37a0a09d7bc9e194fd94279e5c3 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 17 Jun 2012 00:24:54 -0700 Subject: Removed unneeded header style filename #defines (bzr r11503) --- src/live_effects/parameter/unit.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/live_effects/parameter/unit.cpp') diff --git a/src/live_effects/parameter/unit.cpp b/src/live_effects/parameter/unit.cpp index a885577e7..36b6efacc 100644 --- a/src/live_effects/parameter/unit.cpp +++ b/src/live_effects/parameter/unit.cpp @@ -1,5 +1,3 @@ -#define INKSCAPE_LIVEPATHEFFECT_PARAMETER_UNIT_CPP - /* * Copyright (C) Maximilian Albert 2008 * -- cgit v1.2.3 From ef59716bfab870d3193fa9670f2cacc3cca39595 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Thu, 17 Jan 2013 19:23:15 +0100 Subject: const methods (bzr r12037) --- src/live_effects/parameter/unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/live_effects/parameter/unit.cpp') diff --git a/src/live_effects/parameter/unit.cpp b/src/live_effects/parameter/unit.cpp index 36b6efacc..7a2ce6f65 100644 --- a/src/live_effects/parameter/unit.cpp +++ b/src/live_effects/parameter/unit.cpp @@ -59,7 +59,7 @@ UnitParam::param_set_value(SPUnit const *val) } const gchar * -UnitParam::get_abbreviation() +UnitParam::get_abbreviation() const { return sp_unit_get_abbreviation(unit); } -- cgit v1.2.3 From 0cdd007ebf8dcfbd39c1d36ab53f43617eb692df Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Mon, 25 Mar 2013 17:42:31 +0000 Subject: Workaround usage of deprecated glib symbols in 3rd party libraries Fixed bugs: - https://launchpad.net/bugs/1122774 (bzr r12243) --- src/live_effects/parameter/unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/live_effects/parameter/unit.cpp') diff --git a/src/live_effects/parameter/unit.cpp b/src/live_effects/parameter/unit.cpp index 7a2ce6f65..602d806a0 100644 --- a/src/live_effects/parameter/unit.cpp +++ b/src/live_effects/parameter/unit.cpp @@ -4,11 +4,11 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include "ui/widget/registered-widget.h" #include #include "live_effects/parameter/unit.h" #include "live_effects/effect.h" -#include "ui/widget/registered-widget.h" #include "verbs.h" namespace Inkscape { -- cgit v1.2.3 From c60177d361dd435e58caa902a395fa21c9415f51 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 17 Jul 2013 18:12:31 -0400 Subject: Removed "helper/unit.*" dependency from "ui/widget/registered-widget.*". (bzr r12380.1.21) --- src/live_effects/parameter/unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/live_effects/parameter/unit.cpp') diff --git a/src/live_effects/parameter/unit.cpp b/src/live_effects/parameter/unit.cpp index 602d806a0..fffbabb1d 100644 --- a/src/live_effects/parameter/unit.cpp +++ b/src/live_effects/parameter/unit.cpp @@ -74,7 +74,7 @@ UnitParam::param_newWidget() param_effect->getRepr(), param_effect->getSPDoc())); - unit_menu->setUnit(unit); + unit_menu->setUnit(unit->abbr); unit_menu->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change unit parameter")); return dynamic_cast (unit_menu); -- cgit v1.2.3 From 5b8a6e510cb69d33bc8834a7586142be800471b5 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 16:31:57 -0400 Subject: Ported "live_effects/parameter/unit.*". (bzr r12380.1.41) --- src/live_effects/parameter/unit.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/live_effects/parameter/unit.cpp') diff --git a/src/live_effects/parameter/unit.cpp b/src/live_effects/parameter/unit.cpp index fffbabb1d..264b4b9ee 100644 --- a/src/live_effects/parameter/unit.cpp +++ b/src/live_effects/parameter/unit.cpp @@ -10,6 +10,7 @@ #include "live_effects/parameter/unit.h" #include "live_effects/effect.h" #include "verbs.h" +#include "util/units.h" namespace Inkscape { @@ -18,10 +19,11 @@ namespace LivePathEffect { UnitParam::UnitParam( const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Inkscape::UI::Widget::Registry* wr, - Effect* effect, SPUnitId default_value) + Effect* effect, Glib::ustring default_unit) : Parameter(label, tip, key, wr, effect) { - defunit = &sp_unit_get_by_id(default_value);; + Inkscape::Util::UnitTable unit_table; + defunit = new Inkscape::Util::Unit(unit_table.getUnit(default_unit)); unit = defunit; } @@ -32,9 +34,9 @@ UnitParam::~UnitParam() bool UnitParam::param_readSVGValue(const gchar * strvalue) { - SPUnit const *newval = sp_unit_get_by_abbreviation(strvalue); - if (newval) { - param_set_value(newval); + Inkscape::Util::UnitTable unit_table; + if (strvalue) { + param_set_value(unit_table.getUnit(strvalue)); return true; } return false; @@ -43,25 +45,25 @@ UnitParam::param_readSVGValue(const gchar * strvalue) gchar * UnitParam::param_getSVGValue() const { - return g_strdup(sp_unit_get_abbreviation(unit)); + return g_strdup(unit->abbr.c_str()); } void UnitParam::param_set_default() { - param_set_value(defunit); + param_set_value(*defunit); } void -UnitParam::param_set_value(SPUnit const *val) +UnitParam::param_set_value(Inkscape::Util::Unit const &val) { - unit = val; + unit = new Inkscape::Util::Unit(val); } const gchar * UnitParam::get_abbreviation() const { - return sp_unit_get_abbreviation(unit); + return unit->abbr.c_str(); } Gtk::Widget * -- cgit v1.2.3 From 6ae6c0bea96eef09907091279e0678aa5f83102d Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sun, 4 Aug 2013 18:01:18 -0400 Subject: Switched to global UnitTable. (bzr r12380.1.62) --- src/live_effects/parameter/unit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/live_effects/parameter/unit.cpp') diff --git a/src/live_effects/parameter/unit.cpp b/src/live_effects/parameter/unit.cpp index 264b4b9ee..561766920 100644 --- a/src/live_effects/parameter/unit.cpp +++ b/src/live_effects/parameter/unit.cpp @@ -12,6 +12,8 @@ #include "verbs.h" #include "util/units.h" +using Inkscape::Util::unit_table; + namespace Inkscape { namespace LivePathEffect { @@ -22,7 +24,6 @@ UnitParam::UnitParam( const Glib::ustring& label, const Glib::ustring& tip, Effect* effect, Glib::ustring default_unit) : Parameter(label, tip, key, wr, effect) { - Inkscape::Util::UnitTable unit_table; defunit = new Inkscape::Util::Unit(unit_table.getUnit(default_unit)); unit = defunit; } @@ -34,7 +35,6 @@ UnitParam::~UnitParam() bool UnitParam::param_readSVGValue(const gchar * strvalue) { - Inkscape::Util::UnitTable unit_table; if (strvalue) { param_set_value(unit_table.getUnit(strvalue)); return true; -- cgit v1.2.3 From a970dc423d59ea844bdb1af48d5d9419a5e2a287 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 13 Oct 2013 00:24:05 +0200 Subject: Units: stop newing Unit objects. pass around pointers to "undeletable" Unit objects in the UnitTable. I think we should move to using indexed units, and pass around the index of the unit in the unittable, or smth like that... ? (bzr r12679) --- src/live_effects/parameter/unit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/live_effects/parameter/unit.cpp') diff --git a/src/live_effects/parameter/unit.cpp b/src/live_effects/parameter/unit.cpp index 561766920..0ee553e2c 100644 --- a/src/live_effects/parameter/unit.cpp +++ b/src/live_effects/parameter/unit.cpp @@ -24,7 +24,7 @@ UnitParam::UnitParam( const Glib::ustring& label, const Glib::ustring& tip, Effect* effect, Glib::ustring default_unit) : Parameter(label, tip, key, wr, effect) { - defunit = new Inkscape::Util::Unit(unit_table.getUnit(default_unit)); + defunit = unit_table.getUnit(default_unit); unit = defunit; } @@ -36,7 +36,7 @@ bool UnitParam::param_readSVGValue(const gchar * strvalue) { if (strvalue) { - param_set_value(unit_table.getUnit(strvalue)); + param_set_value(*unit_table.getUnit(strvalue)); return true; } return false; -- cgit v1.2.3