#include "support/lstrings.h"
#include "support/lyxalgo.h"
+using namespace std;
+using namespace lyx::support;
namespace lyx {
-using support::escape;
-
-using std::string;
-using std::vector;
-
InsetLabel::InsetLabel(InsetCommandParams const & p)
: InsetCommand(p, "label")
{}
-std::auto_ptr<Inset> InsetLabel::doClone() const
+CommandInfo const * InsetLabel::findInfo(string const & /* cmdName */)
+{
+ static const char * const paramnames[] = {"name", ""};
+ static const bool isoptional[] = {false};
+ static const CommandInfo info = {1, paramnames, isoptional};
+ return &info;
+}
+
+
+Inset * InsetLabel::clone() const
{
- return std::auto_ptr<Inset>(new InsetLabel(params()));
+ return new InsetLabel(params());
}
-void InsetLabel::getLabelList(Buffer const &, std::vector<docstring> & list) const
+void InsetLabel::getLabelList(Buffer const &, vector<docstring> & list) const
{
list.push_back(getParam("name"));
}
switch (cmd.action) {
case LFUN_INSET_MODIFY: {
- InsetCommandParams p("label");
+ InsetCommandParams p(LABEL_CODE);
// FIXME UNICODE
InsetCommandMailer::string2params("label", to_utf8(cmd.argument()), p);
if (p.getCmdName().empty()) {
}
if (p["name"] != params()["name"])
cur.bv().buffer().changeRefsIfUnique(params()["name"],
- p["name"], Inset::REF_CODE);
+ p["name"], REF_CODE);
setParams(p);
break;
}