From 7350639361eca57a277c6025129f1f372d73d04e Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Wed, 6 Jun 2007 21:19:15 +0000 Subject: [PATCH] Update Toc when navigation menu is trigged. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18693 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/MenuBackend.cpp | 2 ++ src/insets/InsetInclude.cpp | 2 +- src/insets/InsetListingsParams.cpp | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/MenuBackend.cpp b/src/MenuBackend.cpp index dce50f52d1..ec267be215 100644 --- a/src/MenuBackend.cpp +++ b/src/MenuBackend.cpp @@ -705,6 +705,8 @@ void expandToc(Menu & tomenu, Buffer const * buf) return; } + const_cast(buf)->tocBackend().update(); + // Add an entry for the master doc if this is a child doc Buffer const * const master = buf->getMasterBuffer(); if (buf != master) { diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 5c14ba8a0f..35d471bf88 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -889,7 +889,7 @@ void InsetInclude::addToToc(TocList & toclist, Buffer const & buffer, ParConstIt if (!caption.empty()) { Toc & toc = toclist["listing"]; docstring const str = convert(toc.size() + 1) - + ". " + params_["filename"]; + + ". " + from_utf8(caption); // This inset does not have a valid ParConstIterator // so it has to use the iterator of its parent paragraph toc.push_back(TocItem(pit, 0, str)); diff --git a/src/insets/InsetListingsParams.cpp b/src/insets/InsetListingsParams.cpp index b6fe7fb189..827d72861e 100644 --- a/src/insets/InsetListingsParams.cpp +++ b/src/insets/InsetListingsParams.cpp @@ -830,7 +830,11 @@ string InsetListingsParams::getParamValue(string const & param) const { // is this parameter defined? map::const_iterator it = params_.find(param); - return (it == params_.end()) ? string() : it->second; + string par = (it == params_.end()) ? string() : it->second; + if (prefixIs(par, "{") && suffixIs(par, "}")) + return par.substr(1, par.size() - 2); + else + return par; } -- 2.39.2