App: fix PropertyBool::setPathValue()

This commit is contained in:
Zheng, Lei
2020-03-30 09:18:36 +08:00
committed by Yorik van Havre
parent f1f4e2b5f2
commit b2eef61a0b

View File

@@ -2119,8 +2119,12 @@ void PropertyBool::setPathValue(const ObjectIdentifier &path, const boost::any &
setValue(boost::any_cast<bool>(value));
else if (value.type() == typeid(int))
setValue(boost::any_cast<int>(value) != 0);
else if (value.type() == typeid(long))
setValue(boost::any_cast<long>(value) != 0);
else if (value.type() == typeid(double))
setValue(boost::math::round(boost::any_cast<double>(value)));
else if (value.type() == typeid(float))
setValue(boost::math::round(boost::any_cast<float>(value)));
else if (value.type() == typeid(Quantity))
setValue(boost::any_cast<Quantity>(value).getValue() != 0);
else