| 1773 | } |
| 1774 | |
| 1775 | void ObjectIdentifier::importSubNames(const ObjectIdentifier::SubNameMap& subNameMap) |
| 1776 | { |
| 1777 | if (!owner || !owner->getDocument()) { |
| 1778 | return; |
| 1779 | } |
| 1780 | ResolveResults result(*this); |
| 1781 | auto it = subNameMap.find(std::make_pair(result.resolvedDocumentObject, std::string())); |
| 1782 | if (it != subNameMap.end()) { |
| 1783 | auto obj = owner->getDocument()->getObject(it->second.c_str()); |
| 1784 | if (!obj) { |
| 1785 | FC_ERR("Failed to find import object " << it->second << " from " |
| 1786 | << result.resolvedDocumentObject->getFullName()); |
| 1787 | return; |
| 1788 | } |
| 1789 | documentNameSet = false; |
| 1790 | documentName.str.clear(); |
| 1791 | if (documentObjectName.isRealString()) { |
| 1792 | documentObjectName.str = obj->Label.getValue(); |
| 1793 | } |
| 1794 | else { |
| 1795 | documentObjectName.str = obj->getNameInDocument(); |
| 1796 | } |
| 1797 | _cache.clear(); |
| 1798 | } |
| 1799 | if (subObjectName.getString().empty()) { |
| 1800 | return; |
| 1801 | } |
| 1802 | it = subNameMap.find(std::make_pair(result.resolvedDocumentObject, subObjectName.str)); |
| 1803 | if (it == subNameMap.end()) { |
| 1804 | return; |
| 1805 | } |
| 1806 | subObjectName = String(it->second, true); |
| 1807 | _cache.clear(); |
| 1808 | shadowSub.newName.clear(); |
| 1809 | shadowSub.oldName.clear(); |
| 1810 | } |
| 1811 | |
| 1812 | bool ObjectIdentifier::updateElementReference(ExpressionVisitor& v, |
| 1813 | App::DocumentObject* feature, |
nothing calls this directly
no test coverage detected