| 123 | } |
| 124 | |
| 125 | void ViewProviderViewClip::dropObject(App::DocumentObject* docObj) |
| 126 | { |
| 127 | auto dvp = freecad_cast<DrawViewPart*>(docObj); |
| 128 | if (dvp && DrawView::isProjGroupItem(dvp)) { |
| 129 | //DPGI can not be dropped onto the Page if it belongs to DPG |
| 130 | auto* dpgi = static_cast<TechDraw::DrawProjGroupItem*>(docObj); |
| 131 | if (dpgi->getPGroup()) { |
| 132 | return; |
| 133 | } |
| 134 | } |
| 135 | if (!docObj->isDerivedFrom<TechDraw::DrawView>()) { |
| 136 | return; |
| 137 | } |
| 138 | |
| 139 | auto dv = static_cast<TechDraw::DrawView*>(docObj); |
| 140 | TechDraw::DrawPage* pageClip = getObject()->findParentPage(); |
| 141 | TechDraw::DrawPage* pageView = dv->findParentPage(); |
| 142 | if (!pageClip || !pageView) { |
| 143 | return; |
| 144 | } |
| 145 | |
| 146 | if (pageClip != pageView) { |
| 147 | pageView->removeView(dv); |
| 148 | pageClip->addView(dv); |
| 149 | } |
| 150 | |
| 151 | getObject()->addView(dv); |
| 152 | } |
| 153 | |
| 154 | void ViewProviderViewClip::onChanged(const App::Property* prop) |
| 155 | { |
nothing calls this directly
no test coverage detected