]> git.lyx.org Git - features.git/commitdiff
Fix bug discovered by Kornel. See
authorRichard Heck <rgheck@lyx.org>
Mon, 27 Jan 2014 19:58:21 +0000 (14:58 -0500)
committerRichard Heck <rgheck@lyx.org>
Wed, 29 Jan 2014 16:35:48 +0000 (11:35 -0500)
http://marc.info/?l=lyx-devel&m=138590578911716&w=2
If you look at Buffer.cpp, around line 4351, there was a comment about bug 5699. We are seeing the
same crash. The problem is that, although the master does have a GUI, that GUI is in a different window. So the structureChanged() call we do during updateBuffer() is for the TOC in that window, not the TOC in the window we are actually in. So our TocModel::toc_ has been reset and is invalid, though the widget itself has not been updated and looks fine.

This patch tests whether the master is in the same window as the buffer we are updating.

A problem remains, which is noted in a comment.

(cherry picked from commit 3f62601a8f7fc2b5df7c6ecc54a2c331a0264290)

Conflicts:
src/Buffer.cpp

src/Buffer.cpp
status.20x

index c59283a4d84d8aaedb88b7b13c07a3fad3301b46..c902db790ada6f891a024c05763302666efd48db 100644 (file)
@@ -4131,9 +4131,15 @@ void Buffer::updateBuffer(UpdateScope scope, UpdateType utype) const
                if (master != this) {
                        bufToUpdate.insert(this);
                        master->updateBuffer(UpdateMaster, utype);
-                       // Do this here in case the master has no gui associated with it. Then, 
-                       // the TocModel is not updated and TocModel::toc_ is invalid (bug 5699).
-                       if (!master->d->gui_)
+                       // If the master buffer has no gui associated with it, then the TocModel is 
+                       // not updated during the updateBuffer call and TocModel::toc_ is invalid 
+                       // (bug 5699). The same happens if the master buffer is open in a different 
+                       // window. This test catches both possibilities.
+                       // See: http://marc.info/?l=lyx-devel&m=138590578911716&w=2
+                       // There remains a problem here: If there is another child open in yet a third
+                       // window, that TOC is not updated. So some more general solution is needed at
+                       // some point.
+                       if (master->d->gui_ != d->gui_)
                                structureChanged();
 
                        // was buf referenced from the master (i.e. not in bufToUpdate anymore)?
index 3eae2e29be64e4456ac6989f6b150d86470a54ee..51bf7fc4c64a888fc94227f76a3e2927b7cef7c1 100644 (file)
@@ -55,12 +55,12 @@ What's new
 
 * USER INTERFACE
 
-- Fixed python call in listerrors script.
-
-- Fix the missing menu entry for "Insert Branch <branch name>".
+- Fix outliner-related crash when master and child are open in different
+  windows (bug 8948).
 
 - Handle undo in `branch-add' function.
 
+
 * DOCUMENTATION AND LOCALIZATION
 
 
@@ -79,6 +79,6 @@ What's new
 
 * BUILD/INSTALLATION
 
-- improve detection of Qt via pkg-config, especially on Mac OS.
+- Improve detection of Qt via pkg-config, especially on Mac OS.
 
-- fix a couple of compilation warnings.
+- Fix a couple of compilation warnings.