From b05f234facde573a72da1ee521114b33ce02433d Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 18 Sep 2018 12:41:02 +0200 Subject: [PATCH] fix overloaded methods SelectionSingleton::addSelection --- src/Gui/Selection.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp index 13a2124aa0..b4af4c5951 100644 --- a/src/Gui/Selection.cpp +++ b/src/Gui/Selection.cpp @@ -739,12 +739,21 @@ bool SelectionSingleton::addSelection(const char* pDocName, const char* pObjectN temp.DocName = pDocName; temp.FeatName = pObjectName ? pObjectName : ""; - for (std::vector::const_iterator it = pSubNames.begin(); it != pSubNames.end(); ++it) { - temp.SubName = it->c_str(); + if (!pSubNames.empty()) { + for (std::vector::const_iterator it = pSubNames.begin(); it != pSubNames.end(); ++it) { + temp.SubName = it->c_str(); + temp.x = 0; + temp.y = 0; + temp.z = 0; + + _SelList.push_back(temp); + } + } + else { + temp.SubName = ""; temp.x = 0; temp.y = 0; temp.z = 0; - _SelList.push_back(temp); } @@ -789,8 +798,16 @@ bool SelectionSingleton::addSelection(const SelectionObject& obj) } return ok; } + else if (!subNames.empty()) { + bool ok = true; + for (std::size_t i=0; i