summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/spinbutton.cpp
diff options
context:
space:
mode:
authorMatthew Petroff <matthew@mpetroff.net>2013-09-16 03:59:14 +0000
committerMatthew Petroff <matthew@mpetroff.net>2013-09-16 03:59:14 +0000
commitf55a53ef2d861b634ad83622edc5e26430baeae0 (patch)
tree5787aac97d92a5f7c80671af9ef29121bf203700 /src/ui/widget/spinbutton.cpp
parentEnable unit evaluation in toolbars. (diff)
downloadinkscape-f55a53ef2d861b634ad83622edc5e26430baeae0.tar.gz
inkscape-f55a53ef2d861b634ad83622edc5e26430baeae0.zip
C++ify expression evaluator.
(bzr r12475.1.23)
Diffstat (limited to 'src/ui/widget/spinbutton.cpp')
-rw-r--r--src/ui/widget/spinbutton.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ui/widget/spinbutton.cpp b/src/ui/widget/spinbutton.cpp
index 2c95e8b5a..62c17f821 100644
--- a/src/ui/widget/spinbutton.cpp
+++ b/src/ui/widget/spinbutton.cpp
@@ -33,7 +33,7 @@ SpinButton::connect_signals() {
int SpinButton::on_input(double* newvalue)
{
try {
- Inkscape::Util::GimpEevlQuantity result;
+ Inkscape::Util::EvaluatorQuantity result;
if (_unit_menu || _unit_tracker) {
Unit unit;
if (_unit_menu) {
@@ -41,13 +41,15 @@ int SpinButton::on_input(double* newvalue)
} else {
unit = _unit_tracker->getActiveUnit();
}
- result = Inkscape::Util::gimp_eevl_evaluate (get_text().c_str(), &unit);
+ Inkscape::Util::ExpressionEvaluator eval = Inkscape::Util::ExpressionEvaluator(get_text().c_str(), &unit);
+ result = eval.evaluate();
// check if output dimension corresponds to input unit
if (result.dimension != (unit.isAbsolute() ? 1 : 0) ) {
throw Inkscape::Util::EvaluatorException("Input dimensions do not match with parameter dimensions.","");
}
} else {
- result = Inkscape::Util::gimp_eevl_evaluate (get_text().c_str(), NULL);
+ Inkscape::Util::ExpressionEvaluator eval = Inkscape::Util::ExpressionEvaluator(get_text().c_str(), NULL);
+ result = eval.evaluate();
}
*newvalue = result.value;