Skip to content

Commit

Permalink
Gui: fix property view on multiple sub-element selections
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder authored and wwmayer committed Sep 10, 2019
1 parent d959e9f commit 74d7842
Showing 1 changed file with 5 additions and 30 deletions.
35 changes: 5 additions & 30 deletions src/Gui/PropertyView.cpp
Expand Up @@ -335,36 +335,11 @@ void PropertyView::onTimer() {
std::vector<PropInfo> propViewMap;
bool checkLink = true;
ViewProviderDocumentObject *vpLast = 0;
const auto &array = Gui::Selection().getCompleteSelection(false);
for(auto &sel : array) {
if(!sel.pObject) continue;
App::DocumentObject *parent = 0;
App::DocumentObject *ob = sel.pObject->resolve(sel.SubName,&parent);
auto sels = Gui::Selection().getSelectionEx("*");
for(auto &sel : sels) {
App::DocumentObject *ob = sel.getObject();
if(!ob) continue;

// App::Link should be able to handle special case below now, besides, the new
// support of plain group in App::Link breaks because of the code below
#if 0
if(parent) {
auto parentVp = Application::Instance->getViewProvider(parent);
if(parentVp) {
// For special case where the SubName reference can resolve to
// a non-child object (e.g. link array element), the tree view
// will select the parent instead. So we shall show the
// property of the parent as well.
bool found = false;
for(auto child : parentVp->claimChildren()) {
if(ob == child) {
found = true;
break;
}
}
if(!found)
ob = parent;
}
}
#endif

// Do not process an object more than once
if(!objSet.insert(ob).second)
continue;
Expand Down Expand Up @@ -491,7 +466,7 @@ void PropertyView::onTimer() {
dataPropsMap.clear();

for (it = propDataMap.begin(); it != propDataMap.end(); ++it) {
if (it->propList.size() == array.size()) {
if (it->propList.size() == sels.size()) {
if(it->propList[0]->testStatus(App::Property::PropDynamic))
dataPropsMap.emplace(it->propName, std::move(it->propList));
else
Expand All @@ -505,7 +480,7 @@ void PropertyView::onTimer() {
propertyEditorData->buildUp(std::move(dataProps));

for (it = propViewMap.begin(); it != propViewMap.end(); ++it) {
if (it->propList.size() == array.size())
if (it->propList.size() == sels.size())
viewProps.emplace_back(it->propName, std::move(it->propList));
}

Expand Down

0 comments on commit 74d7842

Please sign in to comment.