[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

@@ -35,6 +35,7 @@
#include "QGIViewClip.h"
using namespace TechDrawGui;
using namespace TechDraw;
PROPERTY_SOURCE(TechDrawGui::ViewProviderViewClip, TechDrawGui::ViewProviderDrawingView)
@@ -123,7 +124,8 @@ void ViewProviderViewClip::dragObject(App::DocumentObject* docObj)
void ViewProviderViewClip::dropObject(App::DocumentObject* docObj)
{
if (docObj->isDerivedFrom<TechDraw::DrawProjGroupItem>()) {
auto dvp = freecad_cast<DrawViewPart*>(docObj);
if (dvp && DrawView::isProjGroupItem(dvp)) {
//DPGI can not be dropped onto the Page if it belongs to DPG
auto* dpgi = static_cast<TechDraw::DrawProjGroupItem*>(docObj);
if (dpgi->getPGroup()) {