From aea162cc8d8b0ed702afe6de72b44aa4f3ed4af4 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 17 Dec 2018 09:11:34 +0100 Subject: [PATCH] Check for hidden dirty child on close Fixes: #11405 (cherry picked from commit f87218bbb50e2043d3a052803cdef0bbcdcbc338) --- src/frontends/qt4/GuiView.cpp | 10 +++++++--- status.23x | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 1dda3638ff..9581c73148 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -3019,9 +3019,13 @@ bool GuiView::closeBuffer(Buffer & buf) break; } else { // In this case the child buffer is open but hidden. - // It therefore should not (MUST NOT) be dirty! - LATTEST(child_buf->isClean()); - theBufferList().release(child_buf); + // Even in this case, children can be dirty (e.g., + // after a label change in the master, see #11405). + // Therefore, check this. + if (saveBufferIfNeeded(*child_buf, false)) { + child_buf->removeAutosaveFile(); + theBufferList().release(child_buf); + } } } } diff --git a/status.23x b/status.23x index fe431d3ba5..a83d30b446 100644 --- a/status.23x +++ b/status.23x @@ -56,6 +56,8 @@ What's new - Fix reloading of local layout file (bug 11120). +- Check for dirty hidden child documents when closing (bug 11405). + - Fix selection of unmarked RtL characters with Qt 5.11 (bug 11284). - Fix on-screen display of macros whose name is a single non-letter symbol -- 2.39.5