App: Fix GeoFeature::getGlobalPlacement when rootObj is Link

This fixes a case when in case of rootObj being Link placement was not
calculated correctly due to not changing of the document. While for
original use it was fine as this was mostly used in case where there was
defined non-link root for general case Links can be root objects of the
document.
This commit is contained in:
Kacper Donat
2025-02-17 00:31:02 -03:00
committed by Adrian Insaurralde
parent e18e786f76
commit 6c8f9b28a0
+5
View File
@@ -297,6 +297,11 @@ Base::Placement GeoFeature::getGlobalPlacement(App::DocumentObject* targetObj,
if (targetObj == rootObj) return plc;
if (rootObj->isLink()) {
// Update doc in case its an external link.
doc = rootObj->getLinkedObject()->getDocument();
}
for (auto& name : names) {
App::DocumentObject* obj = doc->getObject(name.c_str());
if (!obj) {