]> git.lyx.org Git - features.git/commitdiff
Check for hidden dirty child on close
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 17 Dec 2018 08:11:34 +0000 (09:11 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 17 Dec 2018 17:46:13 +0000 (18:46 +0100)
Fixes: #11405
(cherry picked from commit f87218bbb50e2043d3a052803cdef0bbcdcbc338)

src/frontends/qt4/GuiView.cpp
status.23x

index 1dda3638ff675a2d6839bf46f74d0fc92d9b18d5..9581c731486aee7926c05e9f9a7ce3e810be1f73 100644 (file)
@@ -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);
+                               }
                        }
                }
        }
index fe431d3ba52bb48a05e2831f5be5c237567cf53a..a83d30b446c30506d84b585be4bed1bba6edadeb 100644 (file)
@@ -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