From 39d3f1161260367371f155316c913c37d5aa96d8 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 29 Jun 2007 10:31:51 +0000 Subject: [PATCH] =?utf8?q?Fix=20this=20bug=20reported=20by=20Mael=20Hill?= =?utf8?q?=C3=A9reau:?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 1. Open a document with child documents, each comprising divisions; 2. Show the outline pane. You can see childs' divisions; 3. Select (view) one of the childs; 4. Close this child doc. The focus comes back to the master doc; 5. Click in the outline pane at some point corresponding to the child doc you closed. LyX crashes with SIGSEGV (instead of reopening the child...). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18939 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/LyXView.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/frontends/LyXView.cpp b/src/frontends/LyXView.cpp index dbf474462d..095a351c79 100644 --- a/src/frontends/LyXView.cpp +++ b/src/frontends/LyXView.cpp @@ -155,6 +155,12 @@ void LyXView::setBuffer(Buffer * b, bool child_document) updateLabels(*newBuffer->getMasterBuffer()); } + if (!b && oldBuffer && oldBuffer->getMasterBuffer() != oldBuffer) + // We are closing oldBuffer which was a child document so we + // must update the labels and section numbering of its master + // Buffer. + updateLabels(*oldBuffer->getMasterBuffer()); + connectBuffer(*newBuffer); // Buffer-dependent dialogs should be updated or -- 2.39.2