diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-08-28 02:14:56 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-08-28 02:14:56 +0000 |
| commit | fcd3b1af971172bf0fbe6eabcd97eaf1223267ba (patch) | |
| tree | b675fddf0de3c0759f825a55e8572c257b094fc1 /src/util | |
| parent | Fix Windows build. (diff) | |
| download | inkscape-fcd3b1af971172bf0fbe6eabcd97eaf1223267ba.tar.gz inkscape-fcd3b1af971172bf0fbe6eabcd97eaf1223267ba.zip | |
Use enum names instead of numbers.
(bzr r12475.1.6)
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/units.cpp | 40 | ||||
| -rw-r--r-- | src/util/units.h | 2 |
2 files changed, 21 insertions, 21 deletions
diff --git a/src/util/units.cpp b/src/util/units.cpp index e7be3f5e6..8bae9c419 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -166,25 +166,25 @@ bool operator!= (const Unit &u1, const Unit &u2) int Unit::svgUnit() const { if (!abbr.compare("px")) - return 1; + return SVGLength::PX; if (!abbr.compare("pt")) - return 2; + return SVGLength::PT; if (!abbr.compare("pc")) - return 3; + return SVGLength::PC; if (!abbr.compare("mm")) - return 4; + return SVGLength::MM; if (!abbr.compare("cm")) - return 5; + return SVGLength::CM; if (!abbr.compare("in")) - return 6; + return SVGLength::INCH; if (!abbr.compare("ft")) - return 7; + return SVGLength::FOOT; if (!abbr.compare("em")) - return 8; + return SVGLength::EM; if (!abbr.compare("ex")) - return 9; + return SVGLength::EX; if (!abbr.compare("%")) - return 10; + return SVGLength::PERCENT; return 0; } @@ -224,25 +224,25 @@ Unit UnitTable::getUnit(SVGLength::Unit const u) const { Glib::ustring u_str; switch(u) { - case 1: + case SVGLength::PX: u_str = "px"; break; - case 2: + case SVGLength::PT: u_str = "pt"; break; - case 3: + case SVGLength::PC: u_str = "pc"; break; - case 4: + case SVGLength::MM: u_str = "mm"; break; - case 5: + case SVGLength::CM: u_str = "cm"; break; - case 6: + case SVGLength::INCH: u_str = "in"; break; - case 7: + case SVGLength::FOOT: u_str = "ft"; break; - case 8: + case SVGLength::EM: u_str = "em"; break; - case 9: + case SVGLength::EX: u_str = "ex"; break; - case 10: + case SVGLength::PERCENT: u_str = "%"; break; default: u_str = ""; diff --git a/src/util/units.h b/src/util/units.h index c5ee87ae3..ececc8aa1 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -28,7 +28,7 @@ Need to review the Units support that's in Gtkmm already... #include <map> #include <glibmm/ustring.h> -#include "svg/svg.h" +#include "svg/svg-length.h" namespace Inkscape { namespace Util { |
