From 22d77b784aa2e4f32547b06d7f68a4fd7a4385fb Mon Sep 17 00:00:00 2001 From: Eivind Kvedalen Date: Tue, 19 Jan 2016 20:30:03 +0100 Subject: [PATCH] VariableExpression: Add converters for long and bool data types. --- src/App/Expression.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/App/Expression.cpp b/src/App/Expression.cpp index d78820cb292a..c915c4e64798 100644 --- a/src/App/Expression.cpp +++ b/src/App/Expression.cpp @@ -1031,6 +1031,16 @@ Expression * VariableExpression::eval() const return new NumberExpression(owner, ivalue); } + else if (value.type() == typeid(long)) { + long lvalue = boost::any_cast(value); + + return new NumberExpression(owner, lvalue); + } + else if (value.type() == typeid(bool)) { + double bvalue = boost::any_cast(value) ? 1.0 : 0.0; + + return new NumberExpression(owner, bvalue); + } else if (value.type() == typeid(std::string)) { std::string svalue = boost::any_cast(value);