]> git.lyx.org Git - features.git/commitdiff
Update Toc when navigation menu is trigged.
authorBo Peng <bpeng@lyx.org>
Wed, 6 Jun 2007 21:19:15 +0000 (21:19 +0000)
committerBo Peng <bpeng@lyx.org>
Wed, 6 Jun 2007 21:19:15 +0000 (21:19 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18693 a592a061-630c-0410-9148-cb99ea01b6c8

src/MenuBackend.cpp
src/insets/InsetInclude.cpp
src/insets/InsetListingsParams.cpp

index dce50f52d11a7259bc08c0c5d71b5305401ae91a..ec267be21543df9c0465f3dfb0ef47474c3de3da 100644 (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) {
index 5c14ba8a0f4fa15a9aa831b8c3623c5bd7660e83..35d471bf8872f30e81fd83610c6d3d9a10168368 100644 (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));
index b6fe7fb1890d8ebe5cf6d2f6e67d9e701c461491..827d72861ed36488214cdf81b7db016e96849a26 100644 (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;
 }