diff --git a/src/Mod/Part/App/AttachableObject.cpp b/src/Mod/Part/App/AttachableObject.cpp index 860a19f94..972915507 100644 --- a/src/Mod/Part/App/AttachableObject.cpp +++ b/src/Mod/Part/App/AttachableObject.cpp @@ -140,16 +140,6 @@ App::DocumentObjectExecReturn *AttachableObject::execute() return Part::Feature::execute(); } -namespace Attacher { - void setReadonlyness(App::Property &prop, bool on) - { - unsigned long status = prop.getStatus(); - prop.setStatus(App::Property::ReadOnly, on); - if (status != prop.getStatus()) - App::GetApplication().signalChangePropertyEditor(prop); - } -} - void AttachableObject::onChanged(const App::Property* prop) { if(! this->isRestoring()){ @@ -172,8 +162,8 @@ void AttachableObject::onChanged(const App::Property* prop) } eMapMode mmode = eMapMode(this->MapMode.getValue()); - setReadonlyness(this->superPlacement, !bAttached); - setReadonlyness(this->Placement, bAttached && mmode != mmTranslate); //for mmTranslate, orientation should remain editable even when attached. + this->superPlacement.setReadOnly(!bAttached); + this->Placement.setReadOnly(bAttached && mmode != mmTranslate); //for mmTranslate, orientation should remain editable even when attached. } } diff --git a/src/Mod/Part/App/FeatureRevolution.cpp b/src/Mod/Part/App/FeatureRevolution.cpp index a35a948a3..66408b10d 100644 --- a/src/Mod/Part/App/FeatureRevolution.cpp +++ b/src/Mod/Part/App/FeatureRevolution.cpp @@ -67,20 +67,12 @@ short Revolution::mustExecute() const return 0; } -void setReadonlyness(App::Property &prop, bool on) -{ - unsigned long status = prop.getStatus(); - prop.setStatus(App::Property::ReadOnly, on); - if (status != prop.getStatus()) - App::GetApplication().signalChangePropertyEditor(prop); -} - void Revolution::onChanged(const App::Property* prop) { if(! this->isRestoring()){ if(prop == &AxisLink){ - setReadonlyness(Base, AxisLink.getValue() != nullptr); - setReadonlyness(Axis, AxisLink.getValue() != nullptr); + Base.setReadOnly(AxisLink.getValue() != nullptr); + Axis.setReadOnly(AxisLink.getValue() != nullptr); } } Part::Feature::onChanged(prop);