]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNomencl.cpp
Fix GRAPHICS_EDIT of InsetGraphics
[lyx.git] / src / insets / InsetNomencl.cpp
index c2fdade285797ad19269eea8d169c429a036dbe4..10aef0f51d62d63f2bbbd857fc8cff8bbef4a2f7 100644 (file)
@@ -16,7 +16,7 @@
 #include "Buffer.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "InsetIterator.h"
 #include "LaTeXFeatures.h"
 #include "MetricsInfo.h"
 
 #include "support/docstream.h"
 
+using namespace std;
 
 namespace lyx {
 
-using std::string;
 
+/////////////////////////////////////////////////////////////////////
+//
+// InsetPrintNomencl
+//
+/////////////////////////////////////////////////////////////////////
 
 InsetNomencl::InsetNomencl(InsetCommandParams const & p)
        : InsetCommand(p, "nomenclature"),
@@ -36,23 +41,25 @@ InsetNomencl::InsetNomencl(InsetCommandParams const & p)
 {}
 
 
-CommandInfo const * InsetNomencl::findInfo(std::string const & /* cmdName */)
+ParamInfo const & InsetNomencl::findInfo(string const & /* cmdName */)
 {
-       static const char * const paramnames[] = {"prefix", "symbol", "description", ""};
-       static const bool isoptional[] = {true, false, false};
-       static const CommandInfo info = {3, paramnames, isoptional};
-       return &info;
+       static ParamInfo param_info_;
+       if (param_info_.empty()) {
+               param_info_.add("prefix", ParamInfo::LATEX_OPTIONAL);
+               param_info_.add("symbol", ParamInfo::LATEX_REQUIRED);
+               param_info_.add("description", ParamInfo::LATEX_REQUIRED);
+       }
+       return param_info_;
 }
 
 
-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"))
@@ -81,32 +88,38 @@ void InsetNomencl::validate(LaTeXFeatures & features) const
 }
 
 
+/////////////////////////////////////////////////////////////////////
+//
+// InsetPrintNomencl
+//
+/////////////////////////////////////////////////////////////////////
+
 InsetPrintNomencl::InsetPrintNomencl(InsetCommandParams const & p)
        : InsetCommand(p, string())
 {}
 
 
-CommandInfo const * InsetPrintNomencl::findInfo(std::string const & /* cmdName */)
+ParamInfo const & InsetPrintNomencl::findInfo(string const & /* cmdName */)
 {
-               static const char * const paramnames[] = {"labelwidth", ""};
-               static const bool isoptional[] = {true};
-               static const CommandInfo info = {1, paramnames, isoptional};
-               return &info;
+       static ParamInfo param_info_;
+       if (param_info_.empty()) {
+               param_info_.add("labelwidth", ParamInfo::LATEX_REQUIRED);
+       }
+       return param_info_;
 }
 
 
-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;) {
+       for (InsetIterator it = inset_iterator_begin(buffer().inset()); it;) {
                if (it->lyxCode() == NOMENCL_CODE) {
                        newlines += static_cast<InsetNomencl const &>(*it).docbookGlossary(os);
                        ++it;