| 142 | } |
| 143 | |
| 144 | DocumentView* UIContext::getFirstDocumentView(doc::Document* document) const |
| 145 | { |
| 146 | Workspace* workspace = App::instance()->workspace(); |
| 147 | if (!workspace) // Workspace (main window) can be null if we are in --batch mode |
| 148 | return nullptr; |
| 149 | |
| 150 | for (WorkspaceView* view : *workspace) { |
| 151 | if (DocumentView* docView = dynamic_cast<DocumentView*>(view)) { |
| 152 | if (docView->document() == document) { |
| 153 | return docView; |
| 154 | } |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | return nullptr; |
| 159 | } |
| 160 | |
| 161 | DocumentViews UIContext::getAllDocumentViews(doc::Document* document) const |
| 162 | { |
no test coverage detected