From 8c004fc98bd5ff117e1b1444f0620152531e1065 Mon Sep 17 00:00:00 2001 From: tetektoza Date: Tue, 2 Sep 2025 21:38:26 +0200 Subject: [PATCH] Gui: Use freecad_cast where possible in CommandView for ClarifySelection --- src/Gui/CommandView.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 8391f5def5..9726e2e6b2 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -3980,12 +3980,11 @@ void StdCmdClarifySelection::activated(int iMsg) Q_UNUSED(iMsg); // Get the active view - auto view = Application::Instance->activeView(); - if (!view || !view->isDerivedFrom(View3DInventor::getClassTypeId())) { + auto view3d = freecad_cast(Application::Instance->activeView()); + if (!view3d) { return; } - auto view3d = static_cast(view); auto viewer = view3d->getViewer(); if (!viewer) { return; @@ -4027,7 +4026,7 @@ void StdCmdClarifySelection::activated(int iMsg) continue; // Cast to ViewProviderDocumentObject to get the object - auto vpDoc = dynamic_cast(vp); + auto vpDoc = freecad_cast(vp); if (!vpDoc) continue;