This patch moves the dialogs hidding/update from BufferView.
Will commit soon. Abdel.
Index: BufferView_pimpl.C =================================================================== --- BufferView_pimpl.C (revision 14787) +++ BufferView_pimpl.C (working copy) @@ -12,6 +12,7 @@ * \author André Pönitz * \author Dekel Tsur * \author Jürgen Vigna + * \author Abdelrazak Younes * * Full author contact details are available in file CREDITS. */ @@ -266,7 +267,6 @@ << " No Buffer!" << endl; // We are closing the buffer, use the first buffer as current buffer_ = bufferlist.first(); - owner_->getDialogs().hideBufferDependent(); } else { // Set current buffer buffer_ = b; @@ -277,7 +277,6 @@ anchor_ref_ = 0; offset_ref_ = 0; - // If we're quitting lyx, don't bother updating stuff if (quitting) return; @@ -297,11 +296,6 @@ cursor_.setCursor(buffer_->getCursor().asDocIterator(&(buffer_->inset()))); cursor_.setSelection(); } - - // Buffer-dependent dialogs should be updated or - // hidden. This should go here because some dialogs (eg ToC) - // require bv_->text. - owner_->getDialogs().updateBufferDependent(true); } update(); Index: frontends/LyXView.C =================================================================== --- frontends/LyXView.C (revision 14787) +++ frontends/LyXView.C (working copy) @@ -134,7 +134,19 @@ if (work_area_->bufferView().buffer()) disconnectBuffer(); + if (!b) + getDialogs().hideBufferDependent(); + work_area_->bufferView().setBuffer(b); + + if (work_area_->bufferView().buffer()) + { + // Buffer-dependent dialogs should be updated or + // hidden. This should go here because some dialogs (eg ToC) + // require bv_->text. + getDialogs().updateBufferDependent(true); + } + updateMenubar(); updateToolbars(); updateLayoutChoice();