* BufferView: delete firstLayout()

* LyXView: save two setLayout() calls that are done in updateLayoutChoice() anyway.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14833 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2006-08-24 16:55:31 +00:00
parent d6a42972ea
commit 4cdd558c70
5 changed files with 1 additions and 36 deletions

View File

@ -93,12 +93,6 @@ void BufferView::setBuffer(Buffer * b)
}
string BufferView::firstLayout()
{
return pimpl_->firstLayout();
}
bool BufferView::loadLyXFile(string const & fn, bool tl)
{
return pimpl_->loadLyXFile(fn, tl);

View File

@ -98,8 +98,6 @@ public:
void setBuffer(Buffer * b);
/// return the buffer being viewed
Buffer * buffer() const;
/// return the first layout of the Buffer.
std::string firstLayout();
/// return the owning main view
LyXView * owner() const;

View File

@ -306,28 +306,6 @@ void BufferView::Pimpl::setBuffer(Buffer * b)
lyx::graphics::Previews::get().generateBufferPreviews(*buffer_);
}
string BufferView::Pimpl::firstLayout()
{
string firstlayout;
// This is done after the layout combox has been populated
if (buffer_) {
size_t i = cursor_.depth() - 1;
// we know we'll eventually find a paragraph
while (true) {
CursorSlice const & slice = cursor_[i];
if (!slice.inset().inMathed()) {
LyXLayout_ptr const layout = slice.paragraph().layout();
firstlayout = layout->name();
break;
}
BOOST_ASSERT(i>0);
--i;
}
}
return firstlayout;
}
void BufferView::Pimpl::resizeCurrentBuffer()
{

View File

@ -46,8 +46,6 @@ public:
Pimpl(BufferView & bv, LyXView * owner);
///
void setBuffer(Buffer * buf);
/// return the first layout of the Buffer.
std::string firstLayout();
///
void resizeCurrentBuffer();
//

View File

@ -139,19 +139,17 @@ void LyXView::setBuffer(Buffer * b)
work_area_->bufferView().setBuffer(b);
updateLayoutChoice();
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);
connectBuffer(*work_area_->bufferView().buffer());
setLayout(work_area_->bufferView().firstLayout());
}
updateMenubar();
updateToolbars();
updateLayoutChoice();
updateWindowTitle();
redrawWorkArea();
}
@ -170,7 +168,6 @@ bool LyXView::loadLyXFile(string const & filename, bool tolastfiles)
updateWindowTitle();
if (loaded) {
connectBuffer(*work_area_->bufferView().buffer());
setLayout(work_area_->bufferView().firstLayout());
showErrorList("Parse");
}
redrawWorkArea();