+ fixes #0001885: Unhandled exception when trying to enter edit-mode for objects while drawing view is active
This commit is contained in:
parent
4d618955b3
commit
ca5062cbfe
|
@ -205,6 +205,13 @@ bool Document::setEdit(Gui::ViewProvider* p, int ModNum)
|
|||
return false;
|
||||
|
||||
View3DInventor *activeView = dynamic_cast<View3DInventor *>(getActiveView());
|
||||
// if the currently active view is not te 3d view search for it and activate it
|
||||
if (!activeView) {
|
||||
activeView = dynamic_cast<View3DInventor *>(getViewOfViewProvider(p));
|
||||
if (activeView)
|
||||
getMainWindow()->setActiveWindow(activeView);
|
||||
}
|
||||
|
||||
if (activeView && activeView->getViewer()->setEditingViewProvider(p,ModNum)) {
|
||||
d->_pcInEdit = p;
|
||||
Gui::TaskView::TaskDialog* dlg = Gui::Control().activeDialog();
|
||||
|
@ -213,8 +220,10 @@ bool Document::setEdit(Gui::ViewProvider* p, int ModNum)
|
|||
if (d->_pcInEdit->isDerivedFrom(ViewProviderDocumentObject::getClassTypeId()))
|
||||
signalInEdit(*(static_cast<ViewProviderDocumentObject*>(d->_pcInEdit)));
|
||||
}
|
||||
else
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -114,10 +114,16 @@ bool ViewProviderPart::doubleClicked(void)
|
|||
{
|
||||
std::string Msg("Edit ");
|
||||
Msg += this->pcObject->Label.getValue();
|
||||
Gui::Command::openCommand(Msg.c_str());
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.setEdit('%s',0)",
|
||||
this->pcObject->getNameInDocument());
|
||||
return true;
|
||||
try {
|
||||
Gui::Command::openCommand(Msg.c_str());
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.setEdit('%s',0)",
|
||||
this->pcObject->getNameInDocument());
|
||||
return true;
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
Base::Console().Error("%s\n", e.what());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void ViewProviderPart::applyColor(const Part::ShapeHistory& hist,
|
||||
|
|
Loading…
Reference in New Issue
Block a user