commit 33103ebc371a9c27add7dc7621e54a7c110fbd05
Author: Tommaso Cucinotta <[email protected]>
Date:   Sat Oct 29 12:32:51 2016 +0200

    Show symbol name and description in plaintext export of nomenclature 
entries.
    
    This addresses one of the issues highlighted in #10459.
    See http://www.lyx.org/trac/ticket/10459
---
 src/insets/InsetNomencl.cpp |    8 ++++++++
 src/insets/InsetNomencl.h   |    3 +++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/insets/InsetNomencl.cpp b/src/insets/InsetNomencl.cpp
index 7ebfe4a..a164a96 100644
--- a/src/insets/InsetNomencl.cpp
+++ b/src/insets/InsetNomencl.cpp
@@ -92,6 +92,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
 {
diff --git a/src/insets/InsetNomencl.h b/src/insets/InsetNomencl.h
index 14507b6..5e161a6 100644
--- a/src/insets/InsetNomencl.h
+++ b/src/insets/InsetNomencl.h
@@ -45,6 +45,9 @@ public:
        ///
        InsetCode lyxCode() const { return NOMENCL_CODE; }
        ///
+       int plaintext(odocstringstream & ods, OutputParams const & op,
+                     size_t max_length = INT_MAX) const;
+       ///
        int docbook(odocstream &, OutputParams const &) const;
        /// Does nothing at the moment.
        docstring xhtml(XHTMLStream &, OutputParams const &) const;

Reply via email to