224 |
224 |
225 // ============================================================================= |
225 // ============================================================================= |
226 // |
226 // |
227 LDDocumentPtr FindDocument (QString name) |
227 LDDocumentPtr FindDocument (QString name) |
228 { |
228 { |
229 for (LDDocumentWeakPtr file : g_allDocuments) |
229 for (LDDocumentWeakPtr weakfile : g_allDocuments) |
230 { |
230 { |
231 if (file != null and file.toStrongRef()->name() == name) |
231 if (weakfile == null) |
232 return file.toStrongRef(); |
232 continue; |
|
233 |
|
234 LDDocumentPtr file (weakfile.toStrongRef()); |
|
235 |
|
236 if (Eq (name, file->name(), file->defaultName())) |
|
237 return file; |
233 } |
238 } |
234 |
239 |
235 return LDDocumentPtr(); |
240 return LDDocumentPtr(); |
236 } |
241 } |
237 |
242 |