From 452f9b208751c4aacec145898879d46d97a24f70 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 22 Dec 2025 07:56:53 -0600 Subject: [PATCH] Part Design: Add sketch sub element names for refs in revolutions (#26227) * part design: partdesign: pd: fix regression issue #26223 add sketch sub element names for refs in revolutions * refractor code to remove else blocks as every condition has a return statement, make lsp happy --- src/Mod/PartDesign/Gui/ReferenceSelection.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Mod/PartDesign/Gui/ReferenceSelection.cpp b/src/Mod/PartDesign/Gui/ReferenceSelection.cpp index ba2abaf0b7..5c86f5ec23 100644 --- a/src/Mod/PartDesign/Gui/ReferenceSelection.cpp +++ b/src/Mod/PartDesign/Gui/ReferenceSelection.cpp @@ -370,14 +370,20 @@ QString getRefStr(const App::DocumentObject* obj, const std::vector return {}; } - if (PartDesign::Feature::isDatum(obj) || obj->isDerivedFrom()) { + if (PartDesign::Feature::isDatum(obj)) { return QString::fromLatin1(obj->getNameInDocument()); } - else if (!sub.empty()) { + + if (!sub.empty() && !sub.front().empty()) { return QString::fromLatin1(obj->getNameInDocument()) + QStringLiteral(":") + QString::fromLatin1(sub.front().c_str()); } + if (obj->isDerivedFrom()) { + // only return bare name for sketches when no subelement is specified + return QString::fromLatin1(obj->getNameInDocument()); + } + return {}; }