diff --git a/src/App/PropertyStandard.cpp b/src/App/PropertyStandard.cpp index 063d59df99..7c963bad68 100644 --- a/src/App/PropertyStandard.cpp +++ b/src/App/PropertyStandard.cpp @@ -154,7 +154,7 @@ void PropertyInteger::setPathValue(const ObjectIdentifier &path, const boost::an setValue(boost::any_cast(value)); else if (value.type() == typeid(double)) setValue(boost::math::round(boost::any_cast(value))); - else if (value.type() == typeid(Quantity) && boost::any_cast(value).getUnit().isEmpty()) + else if (value.type() == typeid(Quantity)) setValue(boost::math::round(boost::any_cast(value).getValue())); else if (value.type() == typeid(int)) setValue(boost::any_cast(value)); @@ -1028,7 +1028,7 @@ void PropertyFloat::setPathValue(const ObjectIdentifier &path, const boost::any if (value.type() == typeid(double)) setValue(boost::any_cast(value)); - else if (value.type() == typeid(Quantity) && boost::any_cast(value).getUnit().isEmpty()) + else if (value.type() == typeid(Quantity)) setValue((boost::any_cast(value)).getValue()); else throw bad_cast(); @@ -2118,7 +2118,7 @@ void PropertyBool::setPathValue(const ObjectIdentifier &path, const boost::any & setValue(boost::any_cast(value) != 0); else if (value.type() == typeid(double)) setValue(boost::math::round(boost::any_cast(value))); - else if (value.type() == typeid(Quantity) && boost::any_cast(value).getUnit().isEmpty()) + else if (value.type() == typeid(Quantity)) setValue(boost::any_cast(value).getValue() != 0); else throw bad_cast();