Coverity: Structurally/Logically dead code

This commit is contained in:
wmayer
2020-07-20 12:07:21 +02:00
parent 410e65ce2f
commit 1a16cde1f5
8 changed files with 13 additions and 24 deletions

View File

@@ -1122,8 +1122,9 @@ void prepareProfileBased(PartDesign::Body *pcActiveBody, Gui::Command* cmd, cons
Gui::Selection().clearSelection();
pickDlg = new PartDesignGui::TaskDlgFeaturePick(sketches, status, accepter, sketch_worker);
if (!bNoSketchWasSelected && extReference)
pickDlg->showExternal(true);
// Logically dead code because 'bNoSketchWasSelected' must be true
//if (!bNoSketchWasSelected && extReference)
// pickDlg->showExternal(true);
Gui::Control().showDialog(pickDlg);
}

View File

@@ -217,10 +217,7 @@ void getReferencedSelection(const App::DocumentObject* thisObj, const Gui::Selec
bool originfeature = selObj->isDerivedFrom(App::OriginFeature::getClassTypeId());
if (!originfeature && body) {
PartDesign::Body* selBody = PartDesignGui::getBodyFor(selObj, false);
if(!selBody || body != selBody) {
auto* pcActivePart = PartDesignGui::getPartFor(body, false);
if (!selBody || body != selBody) {
QDialog dia(Gui::getMainWindow());
Ui_DlgReference dlg;
dlg.setupUi(&dia);
@@ -230,14 +227,11 @@ void getReferencedSelection(const App::DocumentObject* thisObj, const Gui::Selec
selObj = NULL;
return;
}
else if(!dlg.radioXRef->isChecked()) {
else if (!dlg.radioXRef->isChecked()) {
App::Document* document = thisObj->getDocument();
document->openTransaction("Make copy");
auto copy = PartDesignGui::TaskFeaturePick::makeCopy(selObj, subname, dlg.radioIndependent->isChecked());
if (body)
body->addObject(copy);
else if (pcActivePart)
pcActivePart->addObject(copy);
body->addObject(copy);
selObj = copy;
subname.erase(std::remove_if(subname.begin(), subname.end(), &isdigit), subname.end());