]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNomencl.cpp
Move isMultiCell() to Cursor, and use it.
[lyx.git] / src / insets / InsetNomencl.cpp
index 67da9b8e788080a08d98ef5593456df3219ce0a5..e063795760c29b9bc1392cc4f60e46e4f2a270cd 100644 (file)
 #include "Buffer.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
-#include "support/gettext.h"
 #include "InsetIterator.h"
 #include "LaTeXFeatures.h"
 #include "MetricsInfo.h"
 #include "sgml.h"
 
 #include "support/docstream.h"
+#include "support/gettext.h"
 
 using namespace std;
 
 namespace lyx {
 
 
+/////////////////////////////////////////////////////////////////////
+//
+// InsetPrintNomencl
+//
+/////////////////////////////////////////////////////////////////////
+
 InsetNomencl::InsetNomencl(InsetCommandParams const & p)
        : InsetCommand(p, "nomenclature"),
          nomenclature_entry_id(sgml::uniqueID(from_ascii("nomen")))
@@ -47,14 +53,13 @@ ParamInfo const & InsetNomencl::findInfo(string const & /* cmdName */)
 }
 
 
-docstring const InsetNomencl::getScreenLabel(Buffer const &) const
+docstring InsetNomencl::screenLabel() const
 {
        return _("Nom");
 }
 
 
-int InsetNomencl::docbook(Buffer const &, odocstream & os,
-               OutputParams const &) const
+int InsetNomencl::docbook(odocstream & os, OutputParams const &) const
 {
        os << "<glossterm linkend=\"" << nomenclature_entry_id << "\">"
           << sgml::escapeString(getParam("symbol"))
@@ -83,6 +88,12 @@ void InsetNomencl::validate(LaTeXFeatures & features) const
 }
 
 
+/////////////////////////////////////////////////////////////////////
+//
+// InsetPrintNomencl
+//
+/////////////////////////////////////////////////////////////////////
+
 InsetPrintNomencl::InsetPrintNomencl(InsetCommandParams const & p)
        : InsetCommand(p, string())
 {}
@@ -98,24 +109,23 @@ ParamInfo const & InsetPrintNomencl::findInfo(string const & /* cmdName */)
 }
 
 
-docstring const InsetPrintNomencl::getScreenLabel(Buffer const &) const
+docstring InsetPrintNomencl::screenLabel() const
 {
        return _("Nomenclature");
 }
 
 
-int InsetPrintNomencl::docbook(Buffer const & buf, odocstream & os,
-               OutputParams const &) const
+int InsetPrintNomencl::docbook(odocstream & os, OutputParams const &) const
 {
        os << "<glossary>\n";
        int newlines = 2;
-       for (InsetIterator it = inset_iterator_begin(buf.inset()); it;) {
+       InsetIterator it = inset_iterator_begin(buffer().inset());
+       while (it) {
                if (it->lyxCode() == NOMENCL_CODE) {
                        newlines += static_cast<InsetNomencl const &>(*it).docbookGlossary(os);
                        ++it;
-               } else if(it->lyxCode() == NOTE_CODE &&
-                         static_cast<InsetNote const &>(*it).params().type == InsetNoteParams::Note) {
-                       // Don't output anything nested in note insets
+               } else if (!it->producesOutput()) {
+                       // Ignore contents of insets that are not in output
                        size_t const depth = it.depth();
                        ++it;
                        while (it.depth() > depth)