]> git.lyx.org Git - lyx.git/blobdiff - src/TocBackend.cpp
Include the recently added test files in package
[lyx.git] / src / TocBackend.cpp
index 2ba097cab8327909e8562318eef24c1bdeff5df7..656f326e15c956aef9495823e5d6ef97f8261800 100644 (file)
@@ -25,7 +25,7 @@
 #include "ParIterator.h"
 #include "TextClass.h"
 
-#include "insets/InsetOptArg.h"
+#include "insets/InsetArgument.h"
 
 #include "support/convert.h"
 #include "support/debug.h"
@@ -44,8 +44,8 @@ namespace lyx {
 //
 ///////////////////////////////////////////////////////////////////////////
 
-TocItem::TocItem(DocIterator const & dit, int d, docstring const & s)
-       : dit_(dit), depth_(d), str_(s)
+TocItem::TocItem(DocIterator const & dit, int d, docstring const & s,
+       docstring const & t) : dit_(dit), depth_(d), str_(s), tooltip_(t)
 {
 }
 
@@ -68,6 +68,12 @@ docstring const & TocItem::str() const
 }
 
 
+docstring const & TocItem::tooltip() const
+{
+       return tooltip_.empty() ? str_ : tooltip_;
+}
+
+
 docstring const TocItem::asString() const
 {
        return docstring(4 * depth_, ' ') + str_;
@@ -136,11 +142,11 @@ bool TocBackend::updateItem(DocIterator const & dit)
        InsetList::const_iterator end = par.insetList().end();
        for (; it != end; ++it) {
                Inset & inset = *it->inset;
-               if (inset.lyxCode() == OPTARG_CODE) {
+               if (inset.lyxCode() == ARG_CODE) {
                        if (!tocstring.empty())
                                break;
                        Paragraph const & inset_par =
-                               *static_cast<InsetOptArg&>(inset).paragraphs().begin();
+                               *static_cast<InsetArgument&>(inset).paragraphs().begin();
                        if (!par.labelString().empty())
                                tocstring = par.labelString() + ' ';
                        tocstring += inset_par.asString(AS_STR_INSETS);