]> git.lyx.org Git - lyx.git/blob - src/insets/insetmarginal.C
Final touch 'inset display()'; fix 'is a bit silly' bug
[lyx.git] / src / insets / insetmarginal.C
1 /**
2  * \file insetmarginal.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 Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "insetmarginal.h"
15
16 #include "gettext.h"
17 #include "paragraph.h"
18
19 #include "support/std_ostream.h"
20
21
22 using std::string;
23 using std::auto_ptr;
24 using std::ostream;
25
26
27 InsetMarginal::InsetMarginal(BufferParams const & bp)
28         : InsetFootlike(bp)
29 {
30         setLabel(_("margin"));
31         setInsetName("Marginal");
32 }
33
34
35 InsetMarginal::InsetMarginal(InsetMarginal const & in)
36         : InsetFootlike(in)
37 {
38         setLabel(_("margin"));
39         setInsetName("Marginal");
40 }
41
42
43 auto_ptr<InsetBase> InsetMarginal::clone() const
44 {
45         return auto_ptr<InsetBase>(new InsetMarginal(*this));
46 }
47
48
49 string const InsetMarginal::editMessage() const
50 {
51         return _("Opened Marginal Note Inset");
52 }
53
54
55 int InsetMarginal::latex(Buffer const & buf, ostream & os,
56                          LatexRunParams const & runparams) const
57 {
58         os << "%\n\\marginpar{";
59
60         int const i = inset.latex(buf, os, runparams);
61         os << "%\n}";
62
63         return i + 2;
64 }