From 94f10f5d95aae441dc18576a61b82740b676f299 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 5 May 2014 22:24:16 +0200 Subject: [PATCH] + issue #0001419: FreeCAD crash on Windows 8.1. --- src/Mod/Part/Gui/TaskSweep.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Mod/Part/Gui/TaskSweep.cpp b/src/Mod/Part/Gui/TaskSweep.cpp index fb1c899ab..825bed10e 100644 --- a/src/Mod/Part/Gui/TaskSweep.cpp +++ b/src/Mod/Part/Gui/TaskSweep.cpp @@ -130,13 +130,18 @@ bool SweepWidget::accept() // get the selected object std::string selection; + std::string spineObject, spineLabel; if (matchEdge) { const std::vector& result = edgeFilter.Result[0]; selection = result.front().getAsPropertyLinkSubString(); + spineObject = result.front().getFeatName(); + spineLabel = result.front().getObject()->Label.getValue(); } else { const std::vector& result = partFilter.Result[0]; selection = result.front().getAsPropertyLinkSubString(); + spineObject = result.front().getFeatName(); + spineLabel = result.front().getObject()->Label.getValue(); } QString list, solid, frenet; @@ -160,6 +165,11 @@ bool SweepWidget::accept() for (int i=0; iui.selector->selectedTreeWidget()->topLevelItem(i); QString name = child->data(0, Qt::UserRole).toString(); + if (name == QLatin1String(spineObject.c_str())) { + QMessageBox::critical(this, tr("Wrong selection"), tr("'%1' cannot be used as profile and path.") + .arg(QString::fromUtf8(spineLabel.c_str()))); + return false; + } str << "App.getDocument('" << d->document.c_str() << "')." << name << ", "; }