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.

(cherry picked from commit aeed6fb8fa)
This commit is contained in:
Jean-Marc Lasgouttes 2019-12-16 18:26:55 +01:00
parent dd27c0c4ee
commit b7ec3d8515
2 changed files with 6 additions and 1 deletions

View 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)

View 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