[TD] Use isProjectGroupItem() in remaining cases

- isDerivedFrom<DrawProjGroupItem>() is no longer reliable due to smart
  view creation changes.
This commit is contained in:
wandererfan
2025-09-21 09:56:35 -04:00
committed by Chris Hennes
parent bbb15ea940
commit 3d7db8fb83
5 changed files with 13 additions and 6 deletions

View File

@@ -32,6 +32,7 @@
using namespace TechDrawGui;
using namespace TechDraw;
EXTENSION_PROPERTY_SOURCE(TechDrawGui::ViewProviderPageExtension, Gui::ViewProviderExtension)
@@ -122,7 +123,8 @@ void ViewProviderPageExtension::extensionDropObject(App::DocumentObject* obj)
//this code used to live in ViewProviderPage
void ViewProviderPageExtension::dropObject(App::DocumentObject* obj)
{
if (obj->isDerivedFrom<TechDraw::DrawProjGroupItem>()) {
auto dvp = freecad_cast<TechDraw::DrawViewPart*>(obj);
if (dvp && DrawView::isProjGroupItem(dvp)) {
//DPGI can not be dropped onto the Page if it belongs to DPG
auto* dpgi = static_cast<TechDraw::DrawProjGroupItem*>(obj);
if (dpgi->getPGroup()) {