]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNomencl.cpp
Limit ligature protection to quote ligature chars
[lyx.git] / src / insets / InsetNomencl.cpp
index 953eeea7227c3ebef376ee32e0ec990b2ff7edd8..76bd7b3a0aa8d56da215ddc628cc16c88f23a59d 100644 (file)
@@ -31,6 +31,7 @@
 #include "OutputParams.h"
 #include "output_xhtml.h"
 #include "sgml.h"
+#include "texstream.h"
 #include "TocBackend.h"
 
 #include "frontends/FontMetrics.h"
@@ -75,12 +76,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;
 }
 
@@ -96,6 +93,14 @@ docstring InsetNomencl::toolTip(BufferView const & /*bv*/, int /*x*/, int /*y*/)
 }
 
 
+int InsetNomencl::plaintext(odocstringstream & os,
+        OutputParams const &, size_t) const
+{
+       docstring s = "[" + getParam("symbol") + ": " + getParam("description") + "]";
+       os << s;
+       return s.size();
+}
+
 
 int InsetNomencl::docbook(odocstream & os, OutputParams const &) const
 {
@@ -132,7 +137,8 @@ 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));
@@ -174,7 +180,7 @@ docstring InsetPrintNomencl::screenLabel() const
 
 
 struct NomenclEntry {
-       NomenclEntry() {}
+       NomenclEntry() : par(0) {}
        NomenclEntry(docstring s, docstring d, Paragraph const * p)
          : symbol(s), desc(d), par(p)
        {}