X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetcommandparams.C;h=bd0c208ef2a7603e4dbc9bb076e96821eb204fe7;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=8c7805db85e1196bc91aed8d6fab572375139e50;hpb=dfee51741786227ddbf25263f9a5203864c2be44;p=lyx.git diff --git a/src/insets/insetcommandparams.C b/src/insets/insetcommandparams.C index 8c7805db85..bd0c208ef2 100644 --- a/src/insets/insetcommandparams.C +++ b/src/insets/insetcommandparams.C @@ -117,6 +117,22 @@ InsetCommandParams::findInfo(std::string const & name) return &info; } + // InsetNomencl + if (name == "nomenclature") { + static const char * const paramnames[] = {"prefix", "symbol", "description", ""}; + static const bool isoptional[] = {true, false, false}; + static const CommandInfo info = {3, paramnames, isoptional}; + return &info; + } + + // InsetPrintNomencl + if (name == "printnomenclature") { + static const char * const paramnames[] = {"labelwidth", ""}; + static const bool isoptional[] = {true}; + static const CommandInfo info = {1, paramnames, isoptional}; + return &info; + } + // InsetRef if (name == "eqref" || name == "pageref" || name == "vpageref" || name == "vref" || name == "prettyref" || name == "ref") { @@ -288,6 +304,7 @@ void InsetCommandParams::write(ostream & os) const docstring const InsetCommandParams::getCommand() const { docstring s = '\\' + from_ascii(name_); + bool noparam = true; for (size_t i = 0; i < info_->n; ++i) { if (info_->optional[i]) { if (params_[i].empty()) { @@ -299,15 +316,20 @@ docstring const InsetCommandParams::getCommand() const break; if (!params_[j].empty()) { s += "[]"; + noparam = false; break; } } - } else + } else { s += '[' + params_[i] + ']'; - } else + noparam = false; + } + } else { s += '{' + params_[i] + '}'; + noparam = false; + } } - if (info_->n == 0) + if (noparam) // Make sure that following stuff does not change the // command name. s += "{}";