TechDraw: Check for valid selection before asking for destination page
This commit is contained in:
committed by
WandererFan
parent
90f22b4eba
commit
377ce29b7f
@@ -815,13 +815,6 @@ CmdTechDrawProjectionGroup::CmdTechDrawProjectionGroup() : Command("TechDraw_Pro
|
||||
void CmdTechDrawProjectionGroup::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
TechDraw::DrawPage* page = DrawGuiUtil::findPage(this);
|
||||
if (!page) {
|
||||
return;
|
||||
}
|
||||
std::string PageName = page->getNameInDocument();
|
||||
// auto inlist = page->getInListEx(true);
|
||||
// inlist.insert(page);
|
||||
|
||||
//set projection direction from selected Face
|
||||
//use first object with a face selected
|
||||
@@ -886,6 +879,12 @@ void CmdTechDrawProjectionGroup::activated(int iMsg)
|
||||
return;
|
||||
}
|
||||
|
||||
TechDraw::DrawPage* page = DrawGuiUtil::findPage(this);
|
||||
if (!page) {
|
||||
return;
|
||||
}
|
||||
std::string PageName = page->getNameInDocument();
|
||||
|
||||
Base::Vector3d projDir;
|
||||
Gui::WaitCursor wc;
|
||||
|
||||
@@ -1365,11 +1364,6 @@ CmdTechDrawDraftView::CmdTechDrawDraftView() : Command("TechDraw_DraftView")
|
||||
void CmdTechDrawDraftView::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
TechDraw::DrawPage* page = DrawGuiUtil::findPage(this);
|
||||
if (!page) {
|
||||
return;
|
||||
}
|
||||
std::string PageName = page->getNameInDocument();
|
||||
|
||||
std::vector<App::DocumentObject*> objects =
|
||||
getSelection().getObjectsOfType(App::DocumentObject::getClassTypeId());
|
||||
@@ -1380,6 +1374,12 @@ void CmdTechDrawDraftView::activated(int iMsg)
|
||||
return;
|
||||
}
|
||||
|
||||
TechDraw::DrawPage* page = DrawGuiUtil::findPage(this);
|
||||
if (!page) {
|
||||
return;
|
||||
}
|
||||
std::string PageName = page->getNameInDocument();
|
||||
|
||||
std::pair<Base::Vector3d, Base::Vector3d> dirs = DrawGuiUtil::get3DDirAndRot();
|
||||
for (std::vector<App::DocumentObject*>::iterator it = objects.begin(); it != objects.end();
|
||||
++it) {
|
||||
|
||||
Reference in New Issue
Block a user