TechDraw: decorateLine fix (#21312)
* TechDraw: decorateLine fix * Update CommandAnnotate.cpp
This commit is contained in:
@@ -1424,29 +1424,32 @@ void CmdTechDrawDecorateLine::activated(int iMsg)
|
||||
}
|
||||
|
||||
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
|
||||
TechDraw::DrawViewPart* baseFeat = nullptr;
|
||||
if (selection.empty()) {
|
||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong Selection"),
|
||||
QObject::tr("You must select a View and/or lines."));
|
||||
return;
|
||||
}
|
||||
|
||||
baseFeat = dynamic_cast<TechDraw::DrawViewPart *>(selection[0].getObject());
|
||||
TechDraw::DrawViewPart* baseFeat = nullptr;
|
||||
std::vector<std::string> subNames;
|
||||
|
||||
std::vector<Gui::SelectionObject>::iterator itSel = selection.begin();
|
||||
for (; itSel != selection.end(); itSel++) {
|
||||
if ((*itSel).getObject()->isDerivedFrom<TechDraw::DrawViewPart>()) {
|
||||
subNames = (*itSel).getSubNames();
|
||||
if (!subNames.empty()) {
|
||||
baseFeat = static_cast<TechDraw::DrawViewPart*>((*itSel).getObject());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!baseFeat) {
|
||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong Selection"),
|
||||
QObject::tr("No View in Selection."));
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<std::string> subNames;
|
||||
|
||||
std::vector<Gui::SelectionObject>::iterator itSel = selection.begin();
|
||||
for (; itSel != selection.end(); itSel++) {
|
||||
if ((*itSel).getObject()->isDerivedFrom<TechDraw::DrawViewPart>()) {
|
||||
baseFeat = static_cast<TechDraw::DrawViewPart*> ((*itSel).getObject());
|
||||
subNames = (*itSel).getSubNames();
|
||||
}
|
||||
}
|
||||
std::vector<std::string> edgeNames;
|
||||
for (auto& s: subNames) {
|
||||
std::string geomType = DrawUtil::getGeomTypeFromName(s);
|
||||
|
||||
Reference in New Issue
Block a user