]> git.lyx.org Git - features.git/commitdiff
* insets/InsetText.cpp (addToToc):
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 3 Nov 2008 13:47:12 +0000 (13:47 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 3 Nov 2008 13:47:12 +0000 (13:47 +0000)
* TocBackend.cpp (updateItem): pass option AS_STR_INSETS to asString,
so that insets get a chance to be displayed in ToC.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27238 a592a061-630c-0410-9148-cb99ea01b6c8

src/TocBackend.cpp
src/insets/InsetText.cpp

index 8b2015fd0a12cae9aec267bd4536843f293dcb6a..a0105a6124a2cb3438533e025cabcc9ad7df6d3c 100644 (file)
@@ -137,7 +137,7 @@ bool TocBackend::updateItem(DocIterator const & dit)
                                *static_cast<InsetOptArg&>(inset).paragraphs().begin();
                        if (!par.labelString().empty())
                                tocstring = par.labelString() + ' ';
-                       tocstring += inset_par.asString();
+                       tocstring += inset_par.asString(AS_STR_INSETS);
                        break;
                }
        }
@@ -145,7 +145,7 @@ bool TocBackend::updateItem(DocIterator const & dit)
        int const toclevel = par.layout().toclevel;
        if (toclevel != Layout::NOT_IN_TOC && toclevel >= min_toclevel
                && tocstring.empty())
-                       tocstring = par.asString(AS_STR_LABEL);
+                       tocstring = par.asString(AS_STR_LABEL | AS_STR_INSETS);
 
        const_cast<TocItem &>(*toc_item).str_ = tocstring;
 
index 105553e651c603dfc9e2b5da45587804d2b17746..79cd4e41013cfc8b0b1f20d8eddc03198d791458 100644 (file)
@@ -504,7 +504,7 @@ void InsetText::addToToc(DocIterator const & cdit)
                                        *static_cast<InsetOptArg&>(inset).paragraphs().begin();
                                if (!par.labelString().empty())
                                        tocstring = par.labelString() + ' ';
-                               tocstring += insetpar.asString();
+                               tocstring += insetpar.asString(AS_STR_INSETS);
                                break;
                        }
                        default:
@@ -517,7 +517,7 @@ void InsetText::addToToc(DocIterator const & cdit)
                        dit.pos() = 0;
                        // insert this into the table of contents
                        if (tocstring.empty())
-                               tocstring = par.asString(AS_STR_LABEL);
+                               tocstring = par.asString(AS_STR_LABEL | AS_STR_INSETS);
                        toc.push_back(TocItem(dit, toclevel - min_toclevel, tocstring));
                }