From 1a600cbff0820207a1760d0b2c40baf199030853 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Tue, 9 Oct 2007 08:06:36 +0000 Subject: [PATCH] * GuiToc: make it work. * GuiView::activate event: remove explicit updateToc() call as this is already done as part of updateBufferDependent(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20864 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiToc.cpp | 12 ++++-------- src/frontends/qt4/GuiView.cpp | 1 - 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/frontends/qt4/GuiToc.cpp b/src/frontends/qt4/GuiToc.cpp index 8bcc2303e6..13cd95f782 100644 --- a/src/frontends/qt4/GuiToc.cpp +++ b/src/frontends/qt4/GuiToc.cpp @@ -118,11 +118,7 @@ void GuiToc::goTo(int type, QModelIndex const & index) void GuiToc::updateView() { - toc_models_.clear(); - TocList::const_iterator it = tocs().begin(); - TocList::const_iterator end = tocs().end(); - for (; it != end; ++it) - toc_models_.push_back(new TocModel(it->second)); + widget_->updateView(); } @@ -136,11 +132,9 @@ bool GuiToc::initialiseParams(string const & data) { InsetCommandMailer::string2params("toc", data, params_); - updateView(); - modelReset(); - types_.clear(); type_names_.clear(); + toc_models_.clear(); TocList const & tocs = buffer().getMasterBuffer()-> tocBackend().tocs(); TocList::const_iterator it = tocs.begin(); @@ -148,6 +142,7 @@ bool GuiToc::initialiseParams(string const & data) for (; it != end; ++it) { types_.push_back(it->first); type_names_.push_back(guiName(it->first)); + toc_models_.push_back(new TocModel(it->second)); } string selected_type ; @@ -163,6 +158,7 @@ bool GuiToc::initialiseParams(string const & data) } } + modelReset(); return true; } diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 000be9203e..f801bfe148 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -698,7 +698,6 @@ bool GuiViewBase::event(QEvent * e) connectBuffer(bv.buffer()); // The document structure, name and dialogs might have // changed in another view. - updateToc(); updateWindowTitle(); getDialogs().updateBufferDependent(true); } -- 2.39.5