simplifying a function

Dramatic simplification of legacy code by separating code and data and applying some later C++.
Function removed from Application.cpp as it was in a anonymous namespace and could not easily be subjected to unit testing.
Added ProgramOptionsUtilities.h
This commit is contained in:
berniev
2023-03-08 08:50:46 +10:00
committed by wwmayer
parent eba80267ff
commit de1acd926e
5 changed files with 125 additions and 50 deletions

View File

@@ -89,7 +89,7 @@ void PropertyQuantity::setPyObject(PyObject *value)
{
// Set the unit if Unit object supplied, else check the unit
// and set the value
if (PyObject_TypeCheck(value, &(UnitPy::Type))) {
Base::UnitPy *pcObject = static_cast<Base::UnitPy*>(value);
Base::Unit unit = *(pcObject->getUnitPtr());