]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/LyXView.cpp
updated list of LyX translations
[lyx.git] / src / frontends / LyXView.cpp
index 095a351c799029d64ba11c040350c93672ec7f38..d02a2d93025830fdc2b11ec6ac1261139462ad1c 100644 (file)
@@ -163,6 +163,17 @@ void LyXView::setBuffer(Buffer * b, bool child_document)
 
                connectBuffer(*newBuffer);
 
+               /* FIXME: We need to rebuild the Toc dialog before the others even
+               if it will be rebuilt again in the next line. This avoid a crash when
+               other dialogs are rebuilt before the Toc dialog. The reason is
+               that closing a Buffer triggers an update of all opened dialogs
+               when dispatching LFUN_DIALOG_UPDATE (hence the patch).
+               The path is as following:
+                       setBuffer() -> updateBufferDependent() -> RestoreButton() -> LFUN
+               The problem here is that the Toc dialog has not been
+               reconstructed (because it comes after in the list of dialogs). */
+               updateToc();
+
                // Buffer-dependent dialogs should be updated or
                // hidden. This should go here because some dialogs (eg ToC)
                // require bv_->text.
@@ -406,9 +417,9 @@ void LyXView::updateToolbars()
 }
 
 
-ToolbarInfo::Flags LyXView::getToolbarState(string const & name)
+ToolbarInfo * LyXView::getToolbarInfo(string const & name)
 {
-       return toolbars_->getToolbarState(name);
+       return toolbars_->getToolbarInfo(name);
 }