Gui: Fix regression pointed out in review

paddlestroke:
> Here we actually need to keep App::Origin. Because we do not allow deletion ONLY of origin objects. Not of normal LCS.

While the original code:
```cpp
auto origin = dynamic_cast<App::Origin*>(lcs);
if (origin && !origin->getInList().empty()) {
```
...handles this perfectly fine, intent isn't obvious when reading it.
Using `is<T>()` shows intent better and should avoid similar situations in the future.
This commit is contained in:
Benjamin Nauck
2025-06-12 10:33:56 +02:00
parent 4c66d2e3d4
commit f32fdcf48b

View File

@@ -227,7 +227,7 @@ bool ViewProviderCoordinateSystem::onDelete(const std::vector<std::string> &)
return false;
}
if (lcs && !lcs->getInList().empty()) {
if (lcs->is<App::Origin>() && !lcs->getInList().empty()) {
// Do not allow deletion of origin objects that are not lost.
return false;
}