]> git.lyx.org Git - lyx.git/commitdiff
Do not check again and again for non existing files
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 16 Dec 2019 17:26:55 +0000 (18:26 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 10 Jan 2020 10:24:24 +0000 (11:24 +0100)
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.

(cherry picked from commit aeed6fb8fa35c045697fe6950c6109be8d30884c)

src/insets/InsetInclude.cpp
status.23x

index 9c00bbaa34ededea7be7a6345d66bb619cc6ab81..e21de4d4b8984a914a525b9f4e89e9fe714a853a 100644 (file)
@@ -460,8 +460,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)
index 22b9b5dd234cb76fd21c59934d28a4058f347e5a..4de5e0179e69d0222658bde630d56f77e6b3bf38 100644 (file)
@@ -36,6 +36,9 @@ What's new
 
 - Fix display with Wayland (bug 11692).
 
+- Improve editing performance when there are Include insets that point to
+  non-existing files. (bug 11656).
+
 
 * DOCUMENTATION AND LOCALIZATION