]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlMinipage.C
Compilation fix.
[lyx.git] / src / frontends / controllers / ControlMinipage.C
1 /* This file is part of
2  * ======================================================
3  *
4  *           LyX, The Document Processor
5  *
6  *           Copyright 2001 The LyX Team.
7  *
8  * ======================================================
9  *
10  * \author Jürgen Vigna, jug@sad.it
11  * \author Angus Leeming, a.leeming@ic.ac.uk
12  */
13
14 #include <config.h>
15
16 #ifdef __GNUG__
17 #pragma implementation
18 #endif
19
20 #include "ControlMinipage.h"
21 #include "BufferView.h"
22
23
24 ControlMinipage::ControlMinipage(LyXView & lv, Dialogs & d)
25         : ControlInset<InsetMinipage, MinipageParams>(lv, d)
26 {}
27
28
29 void ControlMinipage::applyParamsToInset()
30 {
31         inset()->pageWidth(params().pageWidth);
32         inset()->pos(params().pos);
33
34         lv_.view()->updateInset(inset(), true);
35 }
36
37
38 void ControlMinipage::applyParamsNoInset()
39 {
40 }
41
42
43 MinipageParams const ControlMinipage::getParams(InsetMinipage const & inset)
44 {
45         return MinipageParams(inset);
46 }
47
48
49 MinipageParams::MinipageParams()
50         : pos(InsetMinipage::top)
51 {}
52
53 MinipageParams::MinipageParams(InsetMinipage const & inset)
54         : pageWidth(inset.pageWidth()), pos(inset.pos())
55 {}
56
57
58 bool operator==(MinipageParams const & p1, MinipageParams const & p2)
59 {
60         return (p1.pageWidth == p2.pageWidth && p1.pos == p2.pos);
61 }
62
63
64 bool operator!=(MinipageParams const & p1, MinipageParams const & p2)
65 {
66         return !(p1 == p2);
67 }