From 4a80af74f429bf3794f65e6e7d2d285506c1f121 Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Thu, 21 Nov 2024 09:28:22 +0100 Subject: [PATCH] PartDesign: revert c09ef94 and a3c4f4b to fix https://github.com/FreeCAD/FreeCAD/issues/17949 --- src/Mod/PartDesign/Gui/Utils.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Utils.cpp b/src/Mod/PartDesign/Gui/Utils.cpp index fc1c92b434..81099b3827 100644 --- a/src/Mod/PartDesign/Gui/Utils.cpp +++ b/src/Mod/PartDesign/Gui/Utils.cpp @@ -89,12 +89,14 @@ bool setEdit(App::DocumentObject *obj, PartDesign::Body *body) { return false; App::DocumentObject *parent = nullptr; std::string subname; - auto activeBody = activeView->getActiveObject(PDBODYKEY); + auto activeBody = activeView->getActiveObject(PDBODYKEY, &parent, &subname); if (activeBody != body) { parent = obj; + subname.clear(); } else { - parent = getParent(obj, subname); + subname += obj->getNameInDocument(); + subname += '.'; } Gui::cmdGuiDocument(parent, std::ostringstream() << "setEdit("