diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 4e3e41ecc0..ae927dd66a 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -338,7 +338,6 @@ void BufferView::Pimpl::setBuffer(Buffer * b) // hidden. This should go here because some dialogs (eg ToC) // require bv_->text. owner_->getDialogs().updateBufferDependent(true); - owner_->setLayout(bv_->text()->getPar(0).layout()->name()); } else { lyxerr[Debug::INFO] << " No Buffer!" << endl; // we are closing the buffer, use the first buffer as current @@ -353,6 +352,11 @@ void BufferView::Pimpl::setBuffer(Buffer * b) owner_->updateLayoutChoice(); owner_->updateWindowTitle(); + // This is done after the layout combox has been populated + if (buffer_) + owner_->setLayout(cursor_.paragraph().layout()->name()); + + if (buffer_ && lyx::graphics::Previews::status() != LyXRC::PREVIEW_OFF) lyx::graphics::Previews::get().generateBufferPreviews(*buffer_); } diff --git a/src/ChangeLog b/src/ChangeLog index 5f2510fc83..bdcb5dd7f8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-07-05 Jean-Marc Lasgouttes + + * BufferView_pimpl.C (setBuffer): set the layout combox value only + after it has been populated + 2004-06-29 Jean-Marc Lasgouttes * text2.C (insertInset): move cursor when inserting inset.