]> git.lyx.org Git - lyx.git/commitdiff
GuiDocument: do not ask switch-back question on document closing
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 16 Jun 2024 13:53:37 +0000 (15:53 +0200)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Sun, 16 Jun 2024 14:58:06 +0000 (10:58 -0400)
(cherry picked from commit c243126eb406c10420fc112ca1d24ae7e8e42a1f)

src/frontends/qt/GuiDocument.cpp

index e020ab92c24acce718e5ee5bd244212b1bac4830..9429acd3a0289bc420ed192653a98a9d91f3ac8e 100644 (file)
@@ -27,6 +27,7 @@
 #include "BranchList.h"
 #include "buffer_funcs.h"
 #include "Buffer.h"
+#include "BufferList.h"
 #include "BufferView.h"
 #include "CiteEnginesList.h"
 #include "Color.h"
@@ -1881,6 +1882,7 @@ void GuiDocument::onBufferViewChanged()
        // And ideally, we should propose to apply without having to switch back
        // (e.g., via a LFUN_BUFFER_PARAMS_APPLY_OTHER)
        if (!prev_buffer_filename_.empty() && prev_buffer_filename_ != new_filename
+           && theBufferList().exists(FileName(prev_buffer_filename_))
            && buttonBox->button(QDialogButtonBox::Apply)->isEnabled()) {
                // Only ask if we haven't yet in this cycle
                int const ret = prompted_ ? 3 : Alert::prompt(_("Unapplied changes"),