]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlMinipage.C
reverse last change
[lyx.git] / src / frontends / controllers / ControlMinipage.C
1 /**
2  * \file ControlMinipage.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Jürgen Vigna
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #include <config.h>
13
14 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include "ControlMinipage.h"
19 #include "BufferView.h"
20
21
22 ControlMinipage::ControlMinipage(LyXView & lv, Dialogs & d)
23         : ControlInset<InsetMinipage, MinipageParams>(lv, d)
24 {}
25
26
27 void ControlMinipage::applyParamsToInset()
28 {
29         inset()->pageWidth(params().pageWidth);
30         inset()->pos(params().pos);
31
32         bufferview()->updateInset(inset(), true);
33 }
34
35
36 void ControlMinipage::applyParamsNoInset()
37 {
38 }
39
40
41 MinipageParams const ControlMinipage::getParams(InsetMinipage const & inset)
42 {
43         return MinipageParams(inset);
44 }
45
46
47 MinipageParams::MinipageParams()
48         : pos(InsetMinipage::top)
49 {}
50
51
52 MinipageParams::MinipageParams(InsetMinipage const & inset)
53         : pageWidth(inset.pageWidth()), pos(inset.pos())
54 {}
55
56
57 bool operator==(MinipageParams const & p1, MinipageParams const & p2)
58 {
59         return (p1.pageWidth == p2.pageWidth && p1.pos == p2.pos);
60 }
61
62
63 bool operator!=(MinipageParams const & p1, MinipageParams const & p2)
64 {
65         return !(p1 == p2);
66 }