]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetRef.cpp
Get rid of spelling and language marks in info inset
[features.git] / src / insets / InsetRef.cpp
index ed43d6a9505c5a4f37aa108cfa46070794890bc4..eab3e69c1c840adc8d79b16ef86c846d4cd00159 100644 (file)
@@ -425,9 +425,11 @@ void InsetRef::toString(odocstream & os) const
 
 void InsetRef::forOutliner(docstring & os, size_t const, bool const) const
 {
-       // There's no need for details in the TOC, and a long label
-       // will just get in the way.
-       os += '#';
+       // It's hard to know what to do here. Should we show XREF in the TOC?
+       // Or should we just show that there is one? For now, we do the former.
+       odocstringstream ods;
+       plaintext(ods, OutputParams(nullptr));
+       os += ods.str();
 }
 
 
@@ -535,7 +537,9 @@ void InsetRef::addToToc(DocIterator const & cpit, bool output_active,
        broken_ = true;
        setBroken(broken_);
        shared_ptr<Toc> toc = backend.toc("label");
-       toc->push_back(TocItem(cpit, 0, screenLabel(), output_active));
+       if (TocBackend::findItem(*toc, 0, label) == toc->end())
+               toc->push_back(TocItem(cpit, 0, label, output_active, true));
+       toc->push_back(TocItem(cpit, 1, screenLabel(), output_active));
        shared_ptr<Toc> toc2 = backend.toc("brokenrefs");
        toc2->push_back(TocItem(cpit, 0, screenLabel(), output_active));
 }