Skip to content

Commit

Permalink
+ avoid throwing exceptions in property editor if not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jan 26, 2016
1 parent d71a12d commit 72328ed
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Gui/propertyeditor/PropertyItem.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 72328ed

Please sign in to comment.