From 9a19a6d927d8cbd07d9987b8a9a0d5a2a2ee2b0a Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 16 Dec 2019 18:26:55 +0100 Subject: [PATCH] Do not check again and again for non existing files If the file of an InsetInclude does not exist, loadIfNeeded will try again and again to look for it. This is very bad for files with many include insets, especially on windows. Fixes bug #11656. --- src/insets/InsetInclude.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 1bd1c5ba02..09d4be3cc7 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -480,8 +480,10 @@ Buffer * InsetInclude::loadIfNeeded() const Buffer * child = theBufferList().getBuffer(included_file); if (!child) { // the readonly flag can/will be wrong, not anymore I think. - if (!included_file.exists()) + if (!included_file.exists()) { + failedtoload_ = true; return 0; + } child = theBufferList().newBuffer(included_file.absFileName()); if (!child) -- 2.39.5