Replace Base::Exception with appropriate subclass
This commit is contained in:
@@ -137,7 +137,7 @@ void CmdTechDrawNewPageDef::activated(int iMsg)
|
||||
commitCommand();
|
||||
TechDraw::DrawPage* fp = dynamic_cast<TechDraw::DrawPage*>(getDocument()->getObject(PageName.c_str()));
|
||||
if (!fp) {
|
||||
throw Base::Exception("CmdTechDrawNewPageDef fp not found\n");
|
||||
throw Base::TypeError("CmdTechDrawNewPageDef fp not found\n");
|
||||
}
|
||||
|
||||
Gui::ViewProvider* vp = Gui::Application::Instance->getDocument(getDocument())->getViewProvider(fp);
|
||||
@@ -217,7 +217,7 @@ void CmdTechDrawNewPage::activated(int iMsg)
|
||||
commitCommand();
|
||||
TechDraw::DrawPage* fp = dynamic_cast<TechDraw::DrawPage*>(getDocument()->getObject(PageName.c_str()));
|
||||
if (!fp) {
|
||||
throw Base::Exception("CmdTechDrawNewPagePick fp not found\n");
|
||||
throw Base::TypeError("CmdTechDrawNewPagePick fp not found\n");
|
||||
}
|
||||
Gui::ViewProvider* vp = Gui::Application::Instance->getDocument(getDocument())->getViewProvider(fp);
|
||||
TechDrawGui::ViewProviderPage* dvp = dynamic_cast<TechDrawGui::ViewProviderPage*>(vp);
|
||||
@@ -309,7 +309,7 @@ void CmdTechDrawNewView::activated(int iMsg)
|
||||
App::DocumentObject *docObj = getDocument()->getObject(FeatName.c_str());
|
||||
TechDraw::DrawViewPart* dvp = dynamic_cast<TechDraw::DrawViewPart *>(docObj);
|
||||
if (!dvp) {
|
||||
throw Base::Exception("CmdTechDrawNewView DVP not found\n");
|
||||
throw Base::TypeError("CmdTechDrawNewView DVP not found\n");
|
||||
}
|
||||
dvp->Source.setValues(shapes);
|
||||
doCommand(Doc,"App.activeDocument().%s.addView(App.activeDocument().%s)",PageName.c_str(),FeatName.c_str());
|
||||
@@ -381,7 +381,7 @@ void CmdTechDrawNewViewSection::activated(int iMsg)
|
||||
App::DocumentObject *docObj = getDocument()->getObject(FeatName.c_str());
|
||||
TechDraw::DrawViewSection* dsv = dynamic_cast<TechDraw::DrawViewSection *>(docObj);
|
||||
if (!dsv) {
|
||||
throw Base::Exception("CmdTechDrawNewViewSection DVS not found\n");
|
||||
throw Base::TypeError("CmdTechDrawNewViewSection DVS not found\n");
|
||||
}
|
||||
dsv->Source.setValues(dvp->Source.getValues());
|
||||
doCommand(Doc,"App.activeDocument().%s.BaseView = App.activeDocument().%s",FeatName.c_str(),BaseName.c_str());
|
||||
@@ -449,7 +449,7 @@ void CmdTechDrawNewViewDetail::activated(int iMsg)
|
||||
App::DocumentObject *docObj = getDocument()->getObject(FeatName.c_str());
|
||||
TechDraw::DrawViewDetail* dvd = dynamic_cast<TechDraw::DrawViewDetail *>(docObj);
|
||||
if (!dvd) {
|
||||
throw Base::Exception("CmdTechDrawNewViewDetail DVD not found\n");
|
||||
throw Base::TypeError("CmdTechDrawNewViewDetail DVD not found\n");
|
||||
}
|
||||
dvd->Source.setValues(dvp->Source.getValues());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user