[LyX/master] GuiDocument: do not ask switch-back question on document closing

Juergen Spitzmueller spitz at lyx.org
Sun Jun 16 13:55:08 UTC 2024


commit c243126eb406c10420fc112ca1d24ae7e8e42a1f
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Jun 16 15:53:37 2024 +0200

    GuiDocument: do not ask switch-back question on document closing
---
 src/frontends/qt/GuiDocument.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp
index 42af55a4df..b86c8b4288 100644
--- a/src/frontends/qt/GuiDocument.cpp
+++ b/src/frontends/qt/GuiDocument.cpp
@@ -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"
@@ -1883,6 +1884,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"),


More information about the lyx-cvs mailing list