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
This commit is contained in:
@@ -370,14 +370,20 @@ QString getRefStr(const App::DocumentObject* obj, const std::vector<std::string>
|
||||
return {};
|
||||
}
|
||||
|
||||
if (PartDesign::Feature::isDatum(obj) || obj->isDerivedFrom<Part::Part2DObject>()) {
|
||||
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<Part::Part2DObject>()) {
|
||||
// only return bare name for sketches when no subelement is specified
|
||||
return QString::fromLatin1(obj->getNameInDocument());
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user