| 2623 | } |
| 2624 | |
| 2625 | std::vector<PropertyLinkSubList::SubSet> PropertyLinkSubList::getSubListValues(bool newStyle) const |
| 2626 | { |
| 2627 | std::vector<PropertyLinkSubList::SubSet> values; |
| 2628 | if (_lValueList.size() != _lSubList.size()) { |
| 2629 | throw Base::ValueError("PropertyLinkSubList::getSubListValues: size of subelements list != " |
| 2630 | "size of objects list"); |
| 2631 | } |
| 2632 | |
| 2633 | assert(_ShadowSubList.size() == _lSubList.size()); |
| 2634 | |
| 2635 | for (std::size_t i = 0; i < _lValueList.size(); i++) { |
| 2636 | App::DocumentObject* link = _lValueList[i]; |
| 2637 | std::string sub; |
| 2638 | if (newStyle && !_ShadowSubList[i].newName.empty()) { |
| 2639 | sub = _ShadowSubList[i].newName; |
| 2640 | } |
| 2641 | else if (!newStyle && !_ShadowSubList[i].oldName.empty()) { |
| 2642 | sub = _ShadowSubList[i].oldName; |
| 2643 | } |
| 2644 | else { |
| 2645 | sub = _lSubList[i]; |
| 2646 | } |
| 2647 | if (values.empty() || values.back().first != link) { |
| 2648 | // new object started, start a new subset. |
| 2649 | values.emplace_back(link, std::vector<std::string>()); |
| 2650 | } |
| 2651 | values.back().second.push_back(sub); |
| 2652 | } |
| 2653 | return values; |
| 2654 | } |
| 2655 | |
| 2656 | PyObject* PropertyLinkSubList::getPyObject() |
| 2657 | { |
no test coverage detected