- Fix crash with clicking on second Listings iten in Navigator (in EmbeddedObject.lyx).

- Fix http://bugzilla.lyx.org/show_bug.cgi?id=4613


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24869 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-05-20 13:09:35 +00:00
parent 641ae02e37
commit 034cccd008
2 changed files with 3 additions and 9 deletions

View File

@ -953,12 +953,6 @@ void MenuDefinition::expandToc(Buffer const * buf)
if (cit->first == "tableofcontents")
continue;
if (cit->first == "listing") {
// FIXME: the listing navigate menu causes a crash for unknown
// reason. See http://bugzilla.lyx.org/show_bug.cgi?id=4613
continue;
}
MenuDefinition submenu;
if (cit->second.size() >= 30) {
FuncRequest f(LFUN_DIALOG_SHOW, "toc " + cit->first);

View File

@ -896,7 +896,6 @@ void InsetInclude::addToToc(DocIterator const & cpit)
docstring str = convert<docstring>(toc.size() + 1)
+ ". " + from_utf8(caption);
DocIterator pit = cpit;
pit.push_back(CursorSlice(*this));
toc.push_back(TocItem(pit, 0, str));
return;
}
@ -937,9 +936,10 @@ void InsetInclude::updateLabels(ParIterator const & it)
listings_label_.clear();
return;
}
Counters & counters = buffer().params().documentClass().counters();
Buffer const & master = *buffer().masterBuffer();
Counters & counters = master.params().documentClass().counters();
docstring const cnt = from_ascii("listing");
listings_label_ = buffer().B_("Program Listing");
listings_label_ = master.B_("Program Listing");
if (counters.hasCounter(cnt)) {
counters.step(cnt);
listings_label_ += " " + convert<docstring>(counters.value(cnt));