diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-08-04 22:01:18 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-08-04 22:01:18 +0000 |
| commit | 6ae6c0bea96eef09907091279e0678aa5f83102d (patch) | |
| tree | 825708d13704e27c33cb90a5269b25ae390cf4d2 /src/ui/widget/unit-tracker.cpp | |
| parent | Fix handling of SVG lengths with spaces [Bug #1208002]. (diff) | |
| download | inkscape-6ae6c0bea96eef09907091279e0678aa5f83102d.tar.gz inkscape-6ae6c0bea96eef09907091279e0678aa5f83102d.zip | |
Switched to global UnitTable.
(bzr r12380.1.62)
Diffstat (limited to 'src/ui/widget/unit-tracker.cpp')
| -rw-r--r-- | src/ui/widget/unit-tracker.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp index 99074be40..5b2dc031b 100644 --- a/src/ui/widget/unit-tracker.cpp +++ b/src/ui/widget/unit-tracker.cpp @@ -17,6 +17,9 @@ #define COLUMN_STRING 0 +using Inkscape::Util::UnitTable; +using Inkscape::Util::unit_table; + namespace Inkscape { namespace UI { namespace Widget { @@ -32,10 +35,9 @@ UnitTracker::UnitTracker(UnitType unit_type) : _priorValues() { _store = gtk_list_store_new(1, G_TYPE_STRING); - static Inkscape::Util::UnitTable unit_table; GtkTreeIter iter; - UnitTable::UnitMap m = _unit_table.units(unit_type); + UnitTable::UnitMap m = unit_table.units(unit_type); UnitTable::UnitMap::iterator m_iter = m.begin(); while(m_iter != m.end()) { Glib::ustring text = (*m_iter).first; @@ -99,7 +101,7 @@ void UnitTracker::setActiveUnit(Inkscape::Util::Unit const *unit) void UnitTracker::setActiveUnitByAbbr(gchar const *abbr) { - Inkscape::Util::Unit u = _unit_table.getUnit(abbr); + Inkscape::Util::Unit u = unit_table.getUnit(abbr); setActiveUnit(&u); } @@ -195,13 +197,13 @@ void UnitTracker::_setActive(gint active) if (found) { gchar *abbr; gtk_tree_model_get(GTK_TREE_MODEL(_store), &iter, COLUMN_STRING, &abbr, -1); - Inkscape::Util::Unit unit = _unit_table.getUnit(abbr); + Inkscape::Util::Unit unit = unit_table.getUnit(abbr); found = gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(_store), &iter, NULL, active); if (found) { gchar *newAbbr; gtk_tree_model_get(GTK_TREE_MODEL(_store), &iter, COLUMN_STRING, &newAbbr, -1); - Inkscape::Util::Unit newUnit = _unit_table.getUnit(newAbbr); + Inkscape::Util::Unit newUnit = unit_table.getUnit(newAbbr); _activeUnit = newUnit; if (_adjList) { |
