PartDesign/Feature: add an optional parameter to getBaseObject() to prevent it from throwing exceptions
In most cases getBaseObject() is used with an exception handler which only detects if it failed but not the reason. This modification allows to use it without excess exception handlers. Also add the same parameter to SketchBased::getVerifiedSketch().
This commit is contained in:
committed by
Stefan Tröger
parent
013381ccb6
commit
55f3f52f54
@@ -167,14 +167,8 @@ void ViewProvider::updateData(const App::Property* prop)
|
||||
|
||||
bool ViewProvider::onDelete(const std::vector<std::string> &)
|
||||
{
|
||||
App::DocumentObject* previous;
|
||||
PartDesign::Feature* feature = static_cast<PartDesign::Feature*>(getObject());
|
||||
|
||||
try {
|
||||
previous = feature->getBaseObject();
|
||||
} catch (const Base::Exception &ex) {
|
||||
previous = 0;
|
||||
}
|
||||
App::DocumentObject* previous = feature->getBaseObject(/* silent = */ true );
|
||||
|
||||
// Make the tip or the previous feature visiable again with preference to the previous one
|
||||
// if the feature was visiable itself
|
||||
|
||||
Reference in New Issue
Block a user