]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlPreamble.C
Small clean-up.
[lyx.git] / src / frontends / controllers / ControlPreamble.C
1 /**
2  * \file ControlPreamble.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Edwin Leuven
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13
14 #include "ControlPreamble.h"
15
16 #include "ViewBase.h"
17
18 #include "buffer.h"
19 #include "bufferparams.h"
20 #include "gettext.h"
21
22 #include "frontends/LyXView.h"
23
24
25 ControlPreamble::ControlPreamble(LyXView & lv, Dialogs & d)
26         : ControlDialogBD(lv, d)
27 {}
28
29
30 void ControlPreamble::apply()
31 {
32         if (!bufferIsAvailable())
33                 return;
34
35         view().apply();
36
37         buffer()->params().preamble = params();
38         buffer()->markDirty();
39         lv_.message(_("LaTeX preamble set"));
40 }
41
42
43 string const & ControlPreamble::params() const
44 {
45         return params_;
46 }
47
48
49 void ControlPreamble::params(string const & newparams)
50 {
51         params_ = newparams;
52 }
53
54
55 void ControlPreamble::setParams()
56 {
57         params_ = buffer()->params().preamble;
58 }
59
60
61 void ControlPreamble::clearParams()
62 {
63         params_.erase();
64 }