From 034cccd008c0bb687e4912dc7af1ac928b4b4729 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Tue, 20 May 2008 13:09:35 +0000 Subject: [PATCH] - 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 --- src/frontends/qt4/Menus.cpp | 6 ------ src/insets/InsetInclude.cpp | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index 81fbc32529..4e7a807d9b 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -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); diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index c5c67f04ab..8784882628 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -896,7 +896,6 @@ void InsetInclude::addToToc(DocIterator const & cpit) docstring str = convert(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(counters.value(cnt));