]> git.lyx.org Git - features.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>
Thu, 26 Dec 2019 15:45:40 +0000 (16:45 +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.

src/insets/InsetInclude.cpp

index 1bd1c5ba0283f0f9686cafb7f175b5069af4cb45..09d4be3cc76c55a2dc9bb382800fda72d4db5fab 100644 (file)
@@ -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)