From bf27b115c0e03b8f86a84e232eb7529fdd0bff78 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Sun, 13 Oct 2019 21:06:41 +0800 Subject: [PATCH] Gui: fix SelectionSingleton::checkSelection() This affects sub-object selection detection --- src/Gui/Selection.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp index ae63d6d8e2..56bd3edba7 100644 --- a/src/Gui/Selection.cpp +++ b/src/Gui/Selection.cpp @@ -1608,9 +1608,13 @@ int SelectionSingleton::checkSelection(const char *pDocName, const char *pObject } if(!selList) selList = &_SelList; + + if(!pSubName) + pSubName = ""; + for (auto &s : *selList) { if (s.DocName==pDocName && s.FeatName==sel.FeatName) { - if(!pSubName || s.SubName==pSubName) + if(s.SubName==pSubName) return 1; if(resolve>1 && boost::starts_with(s.SubName,prefix)) return 1; @@ -1620,7 +1624,7 @@ int SelectionSingleton::checkSelection(const char *pDocName, const char *pObject for(auto &s : *selList) { if(s.pResolvedObject != sel.pResolvedObject) continue; - if(!pSubName) + if(!pSubName[0]) return 1; if(s.elementName.first.size()) { if(s.elementName.first == sel.elementName.first)