+ fix crash when trying to edit broken revolve object

This commit is contained in:
wmayer
2014-07-12 16:13:13 +02:00
parent 72166ceabe
commit f91c64aba9
3 changed files with 19 additions and 2 deletions
@@ -67,6 +67,16 @@ void ViewProviderRevolution::setupContextMenu(QMenu* menu, QObject* receiver, co
bool ViewProviderRevolution::setEdit(int ModNum)
{
if (ModNum == ViewProvider::Default ) {
PartDesign::Revolution* pcRevolution = static_cast<PartDesign::Revolution*>(getObject());
if (pcRevolution->getSketchAxisCount() < 0) {
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Critical);
msgBox.setWindowTitle(QObject::tr("Lost link to base sketch"));
msgBox.setText(QObject::tr("The object can't be edited because the link to the the base sketch is lost."));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
return false;
}
// When double-clicking on the item for this pad the
// object unsets and sets its edit mode without closing
// the task panel