| 448 | } |
| 449 | |
| 450 | Gui::MDIView* ViewProviderDocumentObject::getActiveView() const |
| 451 | { |
| 452 | if (!pcObject) { |
| 453 | throw Base::RuntimeError("View provider detached"); |
| 454 | } |
| 455 | |
| 456 | if (!pcObject->isAttachedToDocument()) { |
| 457 | // Check if view provider is attached to a document as an annotation |
| 458 | for (auto doc : App::GetApplication().getDocuments()) { |
| 459 | auto guiDoc = Gui::Application::Instance->getDocument(doc); |
| 460 | if (guiDoc->isAnnotationViewProvider(this)) { |
| 461 | return guiDoc->getActiveView(); |
| 462 | } |
| 463 | } |
| 464 | return nullptr; |
| 465 | } |
| 466 | |
| 467 | App::Document* pAppDoc = pcObject->getDocument(); |
| 468 | Gui::Document* pGuiDoc = Gui::Application::Instance->getDocument(pAppDoc); |
| 469 | return pGuiDoc->getActiveView(); |
| 470 | } |
| 471 | |
| 472 | Gui::MDIView* ViewProviderDocumentObject::getEditingView() const |
| 473 | { |
nothing calls this directly
no test coverage detected