]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNomencl.cpp
Circumvent odd stmary font metrics (part of #9990).
[lyx.git] / src / insets / InsetNomencl.cpp
index f7f740aa6f4673fbde19818cee36ff27f2141c11..7ebfe4ae2c58657953507f3e3fd0ceae65fcb991 100644 (file)
@@ -75,12 +75,8 @@ ParamInfo const & InsetNomencl::findInfo(string const & /* cmdName */)
 docstring InsetNomencl::screenLabel() const
 {
        size_t const maxLabelChars = 25;
-
        docstring label = _("Nom: ") + getParam("symbol");
-       if (label.size() > maxLabelChars) {
-               label.erase(maxLabelChars - 3);
-               label += "...";
-       }
+       support::truncateWithEllipsis(label, maxLabelChars);
        return label;
 }
 
@@ -132,10 +128,11 @@ void InsetNomencl::validate(LaTeXFeatures & features) const
 }
 
 
-void InsetNomencl::addToToc(DocIterator const & cpit, bool output_active) const
+void InsetNomencl::addToToc(DocIterator const & cpit, bool output_active,
+                                                       UpdateType) const
 {
        docstring const str = getParam("symbol");
-       buffer().tocBackend().toc("nomencl").push_back(TocItem(cpit, 0, str, output_active));
+       buffer().tocBackend().toc("nomencl")->push_back(TocItem(cpit, 0, str, output_active));
 }
 
 
@@ -190,11 +187,11 @@ typedef map<docstring, NomenclEntry > EntryMap;
 
 docstring InsetPrintNomencl::xhtml(XHTMLStream &, OutputParams const & op) const
 {
-       Toc const & toc = buffer().tocBackend().toc("nomencl");
+       shared_ptr<Toc const> toc = buffer().tocBackend().toc("nomencl");
 
        EntryMap entries;
-       Toc::const_iterator it = toc.begin();
-       Toc::const_iterator const en = toc.end();
+       Toc::const_iterator it = toc->begin();
+       Toc::const_iterator const en = toc->end();
        for (; it != en; ++it) {
                DocIterator dit = it->dit();
                Paragraph const & par = dit.innerParagraph();