#include <config.h>
#include "ControlCommand.h"
-#include "Kernel.h"
#include "funcrequest.h"
#include "insets/insetcommand.h"
+using std::string;
+
+namespace lyx {
+namespace frontend {
+
ControlCommand::ControlCommand(Dialog & dialog, string const & lfun_name)
: Dialog::Controller(dialog),
lfun_name_(lfun_name)
bool ControlCommand::initialiseParams(string const & data)
{
- InsetCommandMailer::string2params(data, params_);
+ // The name passed with LFUN_INSET_APPLY is also the name
+ // used to identify the mailer.
+ InsetCommandMailer::string2params(lfun_name_, data, params_);
return true;
}
void ControlCommand::clearParams()
{
- params_.setCmdName(string());
- params_.setOptions(string());
- params_.setContents(string());
+ params_ = InsetCommandParams();
}
string const lfun = InsetCommandMailer::params2string(lfun_name_,
params_);
- kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
+ kernel().dispatch(FuncRequest(getLfun(), lfun));
}
+
+} // namespace frontend
+} // namespace lyx