| 187 | } |
| 188 | |
| 189 | Base::Type DlgExpressionInput::determineTypeVarSet() |
| 190 | { |
| 191 | Base::Type typePath = getTypePath(); |
| 192 | |
| 193 | // The type of the path is leading. If it is one of the types below, we |
| 194 | // can create a property in the varset. |
| 195 | if (typePath == App::PropertyString::getClassTypeId() |
| 196 | || typePath.isDerivedFrom(App::PropertyFloat::getClassTypeId()) |
| 197 | || typePath.isDerivedFrom(App::PropertyInteger::getClassTypeId())) { |
| 198 | return typePath; |
| 199 | } |
| 200 | |
| 201 | // If we cannot determine the type by means of the path, for example when |
| 202 | // dealing with a sketcher constraint list or with the x, y, or z of a |
| 203 | // Placement, the type of the unit allows us to create a property in the |
| 204 | // varset. Since unit properties are derived from App::PropertyFloat, it |
| 205 | // allows us to create a property and set the value. |
| 206 | |
| 207 | std::string unitTypeString = impliedUnit.getTypeString(); |
| 208 | if (unitTypeString.empty()) { |
| 209 | // no type was provided |
| 210 | return Base::Type::BadType; |
| 211 | } |
| 212 | |
| 213 | std::string typeString = "App::Property" + unitTypeString; |
| 214 | // may return badType |
| 215 | return Base::Type::fromName(typeString.c_str()); |
| 216 | } |
| 217 | |
| 218 | bool DlgExpressionInput::typeOkForVarSet() |
| 219 | { |
nothing calls this directly
no test coverage detected