From 774bbbe1b6bab98c93800c59cae00615f3f9fdca Mon Sep 17 00:00:00 2001 From: Richard Kimberly Heck Date: Mon, 18 May 2020 00:06:59 -0400 Subject: [PATCH] Fix bug #11405. We don't actually prevent hidden buffers from being dirty, so we need to save them if they are. (cherry picked from commit b2517d60b8d05ad68c007e120e3b10059d043845) --- src/frontends/qt4/GuiView.cpp | 11 ++++++++--- status.23x | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index ba4cd78dfe..c4d7e03a0b 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -2923,6 +2923,14 @@ void GuiView::writeSession() const { bool GuiView::closeBufferAll() { + + for (auto & buf : theBufferList()) { + if (!saveBufferIfNeeded(*buf, false)) { + // Closing has been cancelled, so abort. + return false; + } + } + // Close the workareas in all other views QList const ids = guiApp->viewIds(); for (int i = 0; i != ids.size(); ++i) { @@ -2934,9 +2942,6 @@ bool GuiView::closeBufferAll() if (!closeWorkAreaAll()) return false; - // Now close the hidden buffers. We prevent hidden buffers from being - // dirty, so we can just close them. - theBufferList().closeAll(); return true; } diff --git a/status.23x b/status.23x index 6a73c73bc1..9c6059ff4f 100644 --- a/status.23x +++ b/status.23x @@ -46,6 +46,8 @@ What's new - Fix crash when rejecting changes and the cursor is in an inset that will be deleted (bug 10316). +- Ask to save hidden dirty documents (bug 11405). + * INTERNALS -- 2.39.5