]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlBranch.C
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlBranch.C
1 /**
2  * \file ControlBranch.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  * \author Martin Vermeer
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "ControlBranch.h"
15
16 #include "buffer.h"
17 #include "bufferparams.h"
18 #include "BranchList.h"
19 #include "funcrequest.h"
20 #include "insets/insetbranch.h"
21
22
23 using std::string;
24 using std::vector;
25
26 namespace lyx {
27 namespace frontend {
28
29 ControlBranch::ControlBranch(Dialog & parent)
30         : Dialog::Controller(parent)
31 {}
32
33
34 bool ControlBranch::initialiseParams(string const & data)
35 {
36         InsetBranchParams params;
37         InsetBranchMailer::string2params(data, params);
38         params_.reset(new InsetBranchParams(params));
39
40         return true;
41 }
42
43
44 void ControlBranch::clearParams()
45 {
46         params_.reset();
47 }
48
49 void ControlBranch::dispatchParams()
50 {
51         string const lfun = InsetBranchMailer::params2string(params());
52         kernel().dispatch(FuncRequest(getLfun(), lfun));
53 }
54
55
56 BranchList const & ControlBranch::branchlist() const
57 {
58         return kernel().buffer().params().branchlist();
59 }
60
61 } // namespace frontend
62 } // namespace lyx