+ avoid throwing exceptions in property editor if not needed
This commit is contained in:
parent
d71a12db05
commit
72328ed0a1
|
@ -83,27 +83,27 @@ void PropertyItem::reset()
|
|||
void PropertyItem::setPropertyData(const std::vector<App::Property*>& items)
|
||||
{
|
||||
//if we have a single property we can bind it for expression handling
|
||||
if(items.size() == 1) {
|
||||
|
||||
if (items.size() == 1) {
|
||||
const App::Property& p = *items.front();
|
||||
|
||||
|
||||
try {
|
||||
if(!(p.getContainer()->isReadOnly(&p))) {
|
||||
|
||||
// Check for 'DocumentObject' as parent because otherwise 'ObjectIdentifier' raises an exception
|
||||
App::DocumentObject * docObj = Base::freecad_dynamic_cast<App::DocumentObject>(p.getContainer());
|
||||
if (docObj && !docObj->isReadOnly(&p)) {
|
||||
App::ObjectIdentifier id(p);
|
||||
std::vector<App::ObjectIdentifier> paths;
|
||||
p.getPaths(paths);
|
||||
|
||||
|
||||
//there may be no paths available in this property (for example an empty constraint list)
|
||||
if(id.getProperty() && !paths.empty())
|
||||
if (id.getProperty() && !paths.empty())
|
||||
bind(id);
|
||||
|
||||
}
|
||||
}
|
||||
//it may happen that setting properties is not possible
|
||||
catch(...) {};
|
||||
catch (...) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
propertyItems = items;
|
||||
updateData();
|
||||
this->initialize();
|
||||
|
|
Loading…
Reference in New Issue
Block a user