[TechDraw] Improve readability of ViewProviderViewPart.cpp
This commit is contained in:
committed by
WandererFan
parent
fc3fdf337c
commit
3b809fe77b
@@ -230,29 +230,31 @@ std::vector<App::DocumentObject*> ViewProviderViewPart::claimChildren(void) cons
|
||||
}
|
||||
return temp;
|
||||
} catch (...) {
|
||||
std::vector<App::DocumentObject*> tmp;
|
||||
return tmp;
|
||||
return std::vector<App::DocumentObject*>();
|
||||
}
|
||||
}
|
||||
bool ViewProviderViewPart::setEdit(int ModNum)
|
||||
{
|
||||
if (ModNum == ViewProvider::Default ) {
|
||||
if (Gui::Control().activeDialog()) { //TaskPanel already open!
|
||||
return false;
|
||||
}
|
||||
TechDraw::DrawViewPart* dvp = getViewObject();
|
||||
TechDraw::DrawViewDetail* dvd = dynamic_cast<TechDraw::DrawViewDetail*>(dvp);
|
||||
if (dvd != nullptr) {
|
||||
// clear the selection (convenience)
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Control().showDialog(new TaskDlgDetail(dvd));
|
||||
if (ModNum != ViewProvider::Default ) {
|
||||
return ViewProviderDrawingView::setEdit(ModNum);
|
||||
}
|
||||
|
||||
if (Gui::Control().activeDialog()) { //TaskPanel already open!
|
||||
return false;
|
||||
}
|
||||
TechDraw::DrawViewPart* dvp = getViewObject();
|
||||
TechDraw::DrawViewDetail* dvd = dynamic_cast<TechDraw::DrawViewDetail*>(dvp);
|
||||
if (dvd != nullptr) {
|
||||
// clear the selection (convenience)
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Control().showDialog(new TaskDlgDetail(dvd));
|
||||
// Gui::Selection().clearSelection();
|
||||
// flush any lingering gui objects
|
||||
Gui::Selection().addSelection(dvd->getDocument()->getName(),
|
||||
dvd->getNameInDocument());
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Selection().addSelection(dvd->getDocument()->getName(),
|
||||
dvd->getNameInDocument());
|
||||
Gui::Selection().addSelection(dvd->getDocument()->getName(),
|
||||
dvd->getNameInDocument());
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Selection().addSelection(dvd->getDocument()->getName(),
|
||||
dvd->getNameInDocument());
|
||||
|
||||
//Gui.ActiveDocument.resetEdit()
|
||||
//>>> # Gui.Selection.addSelection('aaStart121','Detail')
|
||||
@@ -261,11 +263,8 @@ bool ViewProviderViewPart::setEdit(int ModNum)
|
||||
//>>> # Gui.Selection.addSelection('aaStart121','Detail')
|
||||
//>>> # Gui.Selection.clearSelection()
|
||||
//>>> # Gui.Selection.addSelection('aaStart121','Detail')
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return ViewProviderDrawingView::setEdit(ModNum);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user