diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index 2ca71fec62..3adeae38c2 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -1007,30 +1007,31 @@ void prepareProfileBased(PartDesign::Body *pcActiveBody, Gui::Command* cmd, cons } //for additive and subtractive lofts allow the user to preselect the sections - if (which.compare("AdditiveLoft") == 0 || which.compare("SubtractiveLoft") == 0){ + if (which.compare("AdditiveLoft") == 0 || which.compare("SubtractiveLoft") == 0) { std::vector selection = cmd->getSelection().getSelectionEx(); - if (selection.size()>1){ //treat additional selected objects as sections - for (std::vector::size_type ii = 1; ii != selection.size(); ii++){ - if (selection[ii].getObject()->isDerivedFrom(Part::Part2DObject::getClassTypeId())){ + if (selection.size() > 1) { //treat additional selected objects as sections + for (std::vector::size_type ii = 1; ii < selection.size(); ii++) { + if (selection[ii].getObject()->isDerivedFrom(Part::Part2DObject::getClassTypeId())) { auto objCmdSection = Gui::Command::getObjectCmd(selection[ii].getObject()); - FCMD_OBJ_CMD(Feat,"Sections += [" << objCmdSection << "]"); + FCMD_OBJ_CMD(Feat, "Sections += [" << objCmdSection << "]"); } } } } // for additive and subtractive pipes allow the user to preselect the spines - if (which.compare("AdditivePipe") == 0 || which.compare("SubtractivePipe") == 0){ + if (which.compare("AdditivePipe") == 0 || which.compare("SubtractivePipe") == 0) { std::vector selection = cmd->getSelection().getSelectionEx(); - if (selection.size()==2){ //treat additional selected object as spine + if (selection.size() == 2) { //treat additional selected object as spine std::vector subnames = selection[1].getSubNames(); auto objCmdSpine = Gui::Command::getObjectCmd(selection[1].getObject()); - if(selection[1].getObject()->isDerivedFrom(Part::Part2DObject::getClassTypeId()) && subnames.empty()){ + if (selection[1].getObject()->isDerivedFrom(Part::Part2DObject::getClassTypeId()) && subnames.empty()) { FCMD_OBJ_CMD(Feat,"Spine = " << objCmdSpine); - } else { + } + else { std::ostringstream ss; - for(auto &s : subnames){ - if(s.find("Edge") != std::string::npos) + for(auto &s : subnames) { + if (s.find("Edge") != std::string::npos) ss << "'" << s << "',"; } FCMD_OBJ_CMD(Feat,"Spine = (" << objCmdSpine << ", [" << ss.str() << "])"); diff --git a/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp b/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp index 5dd3637c84..3197efb07f 100644 --- a/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskLoftParameters.cpp @@ -108,8 +108,9 @@ TaskLoftParameters::TaskLoftParameters(ViewProviderLoft *LoftView,bool /*newObj* item->setData(Qt::UserRole, QByteArray(obj->getNameInDocument())); ui->listWidgetReferences->addItem(item); } - if (loft->Sections.getValues().size()>0){ - static_cast(vp)->makeTemporaryVisible(true); + + if (!loft->Sections.getValues().empty()) { + LoftView->makeTemporaryVisible(true); } // activate and de-activate dialog elements as appropriate