check for selected sub-elements in sketcher copy function

This commit is contained in:
wmayer
2018-03-17 13:50:07 +01:00
parent 49308811f4
commit ff955c1aa1

View File

@@ -1170,6 +1170,12 @@ void SketcherCopy::activate(bool clone)
// get the needed lists and objects
const std::vector<std::string> &SubNames = selection[0].getSubNames();
if (SubNames.empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("Select elements from a single sketch."));
return;
}
Sketcher::SketchObject* Obj = static_cast<Sketcher::SketchObject*>(selection[0].getObject());
getSelection().clearSelection();