From 35c2e2d11a3a79ec18541b480554c03a2f6adc8e Mon Sep 17 00:00:00 2001 From: John Levon Date: Sun, 21 Jul 2002 18:13:13 +0000 Subject: [PATCH] compile fies, tiny QToc improvement git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4734 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 5 +++++ src/frontends/qt2/Menubar_pimpl.C | 35 ------------------------------- src/frontends/qt2/Menubar_pimpl.h | 2 -- src/frontends/qt2/QToc.C | 10 ++++----- src/frontends/qt2/QToc.h | 3 ++- 5 files changed, 12 insertions(+), 43 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index f2a306a0d7..715831b38e 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2002-07-21 John Levon + + * QToc.h: + * QToc.C: compile fixes, default to depth_(1) + 2002-07-21 John Levon * Menubar_pimpl.C: change for removed menubar stuff diff --git a/src/frontends/qt2/Menubar_pimpl.C b/src/frontends/qt2/Menubar_pimpl.C index 3bbf5915fe..559a730d3e 100644 --- a/src/frontends/qt2/Menubar_pimpl.C +++ b/src/frontends/qt2/Menubar_pimpl.C @@ -75,41 +75,6 @@ void Menubar::Pimpl::makeMenu(QMenuData * parent, MenuItem const & menu) } -void Menubar::Pimpl::set(string const & menu_name) -{ - lyxerr[Debug::GUI] << "Entering Menubar::Pimpl::set " - << "for menu `" << menu_name << "'" << endl; - -#if 0 - if (menu_name != current_menu_name_) { - MenubarMap::iterator mbit = menubarmap_.find(menu_name); - - if (mbit == menubarmap_.end()) { - lyxerr << "ERROR:set: Unknown menu `" << menu_name - << "'" << endl; - return; - } - - if (current_group_) { - lyxerr[Debug::GUI] << " hiding group " - << current_group_ << endl; - fl_hide_object(current_group_); - } - - lyxerr[Debug::GUI] << " showing group " - << mbit->second << endl; - fl_show_object(mbit->second); - current_menu_name_ = menu_name; - current_group_ = mbit->second; - lyxerr[Debug::GUI] << "Menubar::Pimpl::set: Menubar set." - << endl; - } else - lyxerr [Debug::GUI] << "Menubar::Pimpl::set: Nothing to do." - << endl; -#endif -} - - void Menubar::Pimpl::openByName(string const & name) { lyxerr << "Menubar::Pimpl::openByName: menu " << name << endl; diff --git a/src/frontends/qt2/Menubar_pimpl.h b/src/frontends/qt2/Menubar_pimpl.h index 4c46b28534..bd5fde2b33 100644 --- a/src/frontends/qt2/Menubar_pimpl.h +++ b/src/frontends/qt2/Menubar_pimpl.h @@ -38,8 +38,6 @@ struct Menubar::Pimpl { public: /// Pimpl(LyXView *, MenuBackend const &); - /// - void set(string const &); /// Opens a top-level submenu given its name void openByName(string const &); diff --git a/src/frontends/qt2/QToc.C b/src/frontends/qt2/QToc.C index b7cad886a5..8d9ff056eb 100644 --- a/src/frontends/qt2/QToc.C +++ b/src/frontends/qt2/QToc.C @@ -36,7 +36,7 @@ using std::vector; typedef Qt2CB > base_class; QToc::QToc(ControlToc & c, Dialogs &) - : base_class(c, _("Table of contents")) + : base_class(c, _("Table of contents")), depth_(1) {} @@ -79,7 +79,7 @@ void QToc::updateToc(int newdepth) char const * str = dialog_->typeCO->currentText().latin1(); string type (str ? str : ""); - Buffer::SingleList const & contents = controller().getContents(type); + toc::Toc const & contents = controller().getContents(type); // Check if all elements are the same. if (newdepth == depth_ && toclist == contents) { @@ -107,7 +107,7 @@ void QToc::updateToc(int newdepth) // rather than QListViewItem; and the TOC can move in and out an arbitrary number // of levels - for (Buffer::SingleList::const_iterator iter = toclist.begin(); + for (toc::Toc::const_iterator iter = toclist.begin(); iter != toclist.end(); ++iter) { if (iter->depth == curdepth) { // insert it after the last one we processed @@ -155,7 +155,7 @@ void QToc::updateToc(int newdepth) void QToc::select(string const & text) { - Buffer::SingleList::const_iterator iter = toclist.begin(); + toc::Toc::const_iterator iter = toclist.begin(); for (; iter != toclist.end(); ++iter) { if (iter->str == text) @@ -168,7 +168,7 @@ void QToc::select(string const & text) return; } - controller().Goto(iter->par->id()); + controller().goTo(*iter); } diff --git a/src/frontends/qt2/QToc.h b/src/frontends/qt2/QToc.h index ead0c99d5c..b7ae9e981d 100644 --- a/src/frontends/qt2/QToc.h +++ b/src/frontends/qt2/QToc.h @@ -16,6 +16,7 @@ #endif #include "ControlToc.h" +#include "toc.h" #include "Qt2Base.h" @@ -52,7 +53,7 @@ private: virtual void build_dialog(); /// the toc list - Buffer::SingleList toclist; + toc::Toc toclist; /// depth of list shown int depth_;