From 0556a2ca68e9fb171807a9c6fcb3c13939a251ef Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 19 Dec 2018 21:17:59 +0100 Subject: [PATCH] fixes 0002304: Duplicate multi selection of sketch element produces many sketches --- src/Gui/Selection.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp index 2e6587e420..3b8e31f8d2 100644 --- a/src/Gui/Selection.cpp +++ b/src/Gui/Selection.cpp @@ -1247,9 +1247,13 @@ PyObject *SelectionSingleton::sGetSelection(PyObject * /*self*/, PyObject *args) sel = Selection().getSelection(documentName); try { + std::set noduplicates; Py::List list; for (std::vector::iterator it = sel.begin(); it != sel.end(); ++it) { - list.append(Py::asObject(it->pObject->getPyObject())); + noduplicates.insert(it->pObject); + } + for (std::set::iterator it = noduplicates.begin(); it != noduplicates.end(); ++it) { + list.append(Py::asObject((*it)->getPyObject())); } return Py::new_reference_to(list); }