]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCommand.C
small fix
[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 using std::string;
20
21
22 ControlCommand::ControlCommand(Dialog & dialog, string const & lfun_name)
23         : Dialog::Controller(dialog),
24           lfun_name_(lfun_name)
25 {}
26
27
28 bool ControlCommand::initialiseParams(string const & data)
29 {
30         InsetCommandMailer::string2params(data, params_);
31         return true;
32 }
33
34
35 void ControlCommand::clearParams()
36 {
37         params_ = InsetCommandParams();
38 }
39
40
41 void ControlCommand::dispatchParams()
42 {
43         if (lfun_name_.empty())
44                 return;
45
46         string const lfun = InsetCommandMailer::params2string(lfun_name_,
47                                                               params_);
48         kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
49 }