From f32fdcf48b2b9411163c693dbb18ba18080d498c Mon Sep 17 00:00:00 2001 From: Benjamin Nauck Date: Thu, 12 Jun 2025 10:33:56 +0200 Subject: [PATCH] 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(lcs); if (origin && !origin->getInList().empty()) { ``` ...handles this perfectly fine, intent isn't obvious when reading it. Using `is()` shows intent better and should avoid similar situations in the future. --- src/Gui/ViewProviderCoordinateSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gui/ViewProviderCoordinateSystem.cpp b/src/Gui/ViewProviderCoordinateSystem.cpp index f5b7c3f1cc..5541779578 100644 --- a/src/Gui/ViewProviderCoordinateSystem.cpp +++ b/src/Gui/ViewProviderCoordinateSystem.cpp @@ -227,7 +227,7 @@ bool ViewProviderCoordinateSystem::onDelete(const std::vector &) return false; } - if (lcs && !lcs->getInList().empty()) { + if (lcs->is() && !lcs->getInList().empty()) { // Do not allow deletion of origin objects that are not lost. return false; }