From b7ec3d8515b539260a16e9c5987c4116f4d1257c 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. (cherry picked from commit aeed6fb8fa35c045697fe6950c6109be8d30884c) --- src/insets/InsetInclude.cpp | 4 +++- status.23x | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 9c00bbaa34..e21de4d4b8 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -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) diff --git a/status.23x b/status.23x index 22b9b5dd23..4de5e0179e 100644 --- a/status.23x +++ b/status.23x @@ -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