Update Toc when navigation menu is trigged.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18693 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2007-06-06 21:19:15 +00:00
parent 30a63bd86f
commit 7350639361
3 changed files with 8 additions and 2 deletions

View File

@ -705,6 +705,8 @@ void expandToc(Menu & tomenu, Buffer const * buf)
return;
}
const_cast<Buffer*>(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) {

View File

@ -889,7 +889,7 @@ void InsetInclude::addToToc(TocList & toclist, Buffer const & buffer, ParConstIt
if (!caption.empty()) {
Toc & toc = toclist["listing"];
docstring const str = convert<docstring>(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));

View File

@ -830,7 +830,11 @@ string InsetListingsParams::getParamValue(string const & param) const
{
// is this parameter defined?
map<string, string>::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;
}