MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / getFirstDocumentView

Method getFirstDocumentView

src/app/ui_context.cpp:144–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144DocumentView* 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
161DocumentViews UIContext::getAllDocumentViews(doc::Document* document) const
162{

Callers 2

onProcessMessageMethod · 0.80
updateSiteMethod · 0.80

Calls 3

instanceFunction · 0.85
workspaceMethod · 0.80
documentMethod · 0.45

Tested by

no test coverage detected