Gui: fix SelectionSingleton::checkSelection()

This affects sub-object selection detection
This commit is contained in:
Zheng, Lei
2019-10-13 21:06:41 +08:00
committed by wwmayer
parent bea009c1d5
commit bf27b115c0

View File

@@ -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)