]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCommand.C
Small clean-up.
[lyx.git] / src / frontends / controllers / ControlCommand.C
1 /**
2  * \file ControlCommand.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "ControlCommand.h"
14
15 #include "funcrequest.h"
16 #include "insets/insetcommand.h"
17
18
19 ControlCommand::ControlCommand(Dialog & dialog, string const & lfun_name)
20         : Dialog::Controller(dialog),
21           lfun_name_(lfun_name)
22 {}
23
24
25 bool ControlCommand::initialiseParams(string const & data)
26 {
27         InsetCommandMailer::string2params(data, params_);
28         return true;
29 }
30
31
32 void ControlCommand::clearParams()
33 {
34         params_ = InsetCommandParams();
35 }
36
37
38 void ControlCommand::dispatchParams()
39 {
40         if (lfun_name_.empty())
41                 return;
42
43         string const lfun = InsetCommandMailer::params2string(lfun_name_,
44                                                               params_);
45         kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
46 }