X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_ParamSpinBox.cpp;h=57e21b80b345375dec256c0fe0109f6260bf5957;hb=af851100774c4ff33b515c884abe0cd03c3f0528;hp=af554aa84f9742bce8e627c4a1d2b1b22300a253;hpb=d4f365bcf214f4bce0bf84c47915f2d4a819668f;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp index af554aa84..57e21b80b 100644 --- a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp +++ b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -234,16 +235,7 @@ bool ModuleBase_ParamSpinBox::findVariable(const QString& theName, double& outValue) const { - SessionPtr aSession = ModelAPI_Session::get(); - DocumentPtr aDocument = aSession->activeDocument(); - ObjectPtr aParamObj = aDocument->objectByName(ModelAPI_ResultParameter::group(), - theName.toStdString()); - ResultParameterPtr aParam = std::dynamic_pointer_cast(aParamObj); - if(!aParam.get()) - return false; - AttributeDoublePtr aValueAttribute = aParam->data()->real(ModelAPI_ResultParameter::VALUE()); - outValue = aValueAttribute->value(); - return true; + return ModelAPI_Tools::findVariable(theName.toStdString(), outValue); } /*!