mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
fix toc bug
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2102 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
5cc00f4bcd
commit
358a19aca8
@ -24,7 +24,6 @@ src/frontends/controllers/ControlInclude.C
|
||||
src/frontends/controllers/ControlPreamble.C
|
||||
src/frontends/controllers/ControlPrint.C
|
||||
src/frontends/controllers/ControlSearch.C
|
||||
src/frontends/controllers/ControlToc.C
|
||||
src/frontends/controllers/helper_funcs.C
|
||||
src/frontends/gnome/FormCitation.C
|
||||
src/frontends/gnome/FormIndex.C
|
||||
|
@ -1,3 +1,7 @@
|
||||
2001-06-11 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* Makefile.am: make the dependencies work for the sub libs.
|
||||
|
||||
2001-05-31 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* Makefile.am (libfrontends_la_LIBADD): new var, add all subdirs
|
||||
|
@ -15,6 +15,10 @@ libfrontends_la_LIBADD= @FRONTEND_GUILIB@ \
|
||||
support/libfrontendsupport.la \
|
||||
controllers/libcontrollers.la
|
||||
|
||||
libfrontends_la_DEPENDENCIES = @FRONTEND_GUILIB@ \
|
||||
support/libfrontendsupport.la \
|
||||
controllers/libcontrollers.la
|
||||
|
||||
libfrontends_la_SOURCES=\
|
||||
Dialogs.C \
|
||||
Dialogs.h \
|
||||
|
@ -1,3 +1,8 @@
|
||||
2001-06-11 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* ControlToc.C (getContents): don't add anything to the list if it
|
||||
is supposed to be empty.
|
||||
|
||||
2001-06-01 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* helper_funcs.C (getVectorFromString): bug fix.
|
||||
|
@ -64,15 +64,11 @@ vector<string> const ControlToc::getTypes() const
|
||||
|
||||
Buffer::SingleList const ControlToc::getContents(string const & type) const
|
||||
{
|
||||
Buffer::SingleList contents;
|
||||
|
||||
Buffer::TocItem noContent(0, 0, string());
|
||||
Buffer::SingleList empty_list;
|
||||
|
||||
// This shouldn't be possible...
|
||||
if (!lv_.view()->available()) {
|
||||
noContent.str = _("*** No Document ***");
|
||||
contents.push_back(noContent);
|
||||
return contents;
|
||||
return empty_list;
|
||||
}
|
||||
|
||||
Buffer::Lists tmp = lv_.view()->buffer()->getLists();
|
||||
@ -80,9 +76,7 @@ Buffer::SingleList const ControlToc::getContents(string const & type) const
|
||||
Buffer::Lists::iterator it = tmp.find(type);
|
||||
|
||||
if (it == tmp.end()) {
|
||||
noContent.str = _("*** No Lists ***");
|
||||
contents.push_back(noContent);
|
||||
return contents;
|
||||
return empty_list;
|
||||
}
|
||||
|
||||
return it->second;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2001-06-11 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* FormToc.C (input): change test slightly.
|
||||
(updateContents): clear list if empty and add no list msg.
|
||||
|
||||
2001-05-30 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* FormParagraph.C (update, general_update): enabling the align buttons
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include "form_toc.h"
|
||||
#include "helper_funcs.h" // getStringFromVector
|
||||
#include "support/lstrings.h" // frontStrip, strip
|
||||
#include "debug.h"
|
||||
#include "gettext.h"
|
||||
|
||||
|
||||
typedef FormCB<ControlToc, FormDB<FD_form_toc> > base_class;
|
||||
@ -58,7 +60,8 @@ ButtonPolicy::SMInput FormToc::input(FL_OBJECT *, long)
|
||||
updateContents();
|
||||
|
||||
unsigned int const choice = fl_get_browser( dialog_->browser_toc );
|
||||
if (0 < choice && choice - 1 < toclist_.size()) {
|
||||
|
||||
if (choice - 1 < toclist_.size() && choice >= 1) {
|
||||
controller().Goto(toclist_[choice - 1].par->id());
|
||||
}
|
||||
|
||||
@ -91,6 +94,12 @@ void FormToc::updateContents()
|
||||
|
||||
Buffer::SingleList const contents = controller().getContents(type);
|
||||
|
||||
if (contents.empty()) {
|
||||
fl_clear_browser(dialog_->browser_toc);
|
||||
fl_add_browser_line(dialog_->browser_toc,
|
||||
_("*** No Lists ***"));
|
||||
}
|
||||
|
||||
// Check if all elements are the same.
|
||||
if (toclist_ == contents) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user