]> git.lyx.org Git - features.git/commitdiff
This patch moves the dialogs hidding/update from BufferView::setBuffer() to LyXView...
authorAbdelrazak Younes <younes@lyx.org>
Thu, 17 Aug 2006 21:46:52 +0000 (21:46 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 17 Aug 2006 21:46:52 +0000 (21:46 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14798 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/frontends/LyXView.C

index c11601733d254970f32043a8b6675d976418149d..b63b126659a1669c87734d7a0708ce9ab57f7dcd 100644 (file)
@@ -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();
index 1bfeddc89e6f9ac7ba78c3cedb9420cbb6beb1a0..e9bcd1adc101befe632219e02b248fc3bf6eb7e1 100644 (file)
@@ -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();