From 5bda7ca22223655c3722d2767d4b3aa82831cef5 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 17 Aug 2006 21:46:52 +0000 Subject: [PATCH] This patch moves the dialogs hidding/update from BufferView::setBuffer() to LyXView::setBuffer() git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14798 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView_pimpl.C | 8 +------- src/frontends/LyXView.C | 12 ++++++++++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index c11601733d..b63b126659 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -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 @@ void BufferView::Pimpl::setBuffer(Buffer * b) << " 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 @@ void BufferView::Pimpl::setBuffer(Buffer * b) anchor_ref_ = 0; offset_ref_ = 0; - // If we're quitting lyx, don't bother updating stuff if (quitting) return; @@ -297,11 +296,6 @@ void BufferView::Pimpl::setBuffer(Buffer * b) 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(); diff --git a/src/frontends/LyXView.C b/src/frontends/LyXView.C index 1bfeddc89e..e9bcd1adc1 100644 --- a/src/frontends/LyXView.C +++ b/src/frontends/LyXView.C @@ -134,7 +134,19 @@ void LyXView::setBuffer(Buffer * b) 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();