]> git.lyx.org Git - lyx.git/blob - src/insets/insethfill.C
Fix \hfill output which was broken by the InsetCommand changes.
[lyx.git] / src / insets / insethfill.C
1 /**
2  * \file insethfill.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "insethfill.h"
14
15 #include "support/std_ostream.h"
16
17 using lyx::docstring;
18 using lyx::odocstream;
19
20 using std::ostream;
21
22
23 InsetHFill::InsetHFill()
24         : InsetCommand(InsetCommandParams("hfill"), std::string())
25 {}
26
27
28 std::auto_ptr<InsetBase> InsetHFill::doClone() const
29 {
30         return std::auto_ptr<InsetBase>(new InsetHFill);
31 }
32
33
34 void InsetHFill::metrics(MetricsInfo &, Dimension & dim) const
35 {
36         dim.wid = 3;
37         dim.asc = 3;
38         dim.des = 3;
39         dim_ = dim;
40 }
41
42
43 docstring const InsetHFill::getScreenLabel(Buffer const &) const
44 {
45         return lyx::from_ascii(getContents());
46 }
47
48
49 int InsetHFill::latex(Buffer const &, odocstream & os,
50                       OutputParams const &) const
51 {
52         os << getCommand() << "{}";
53         return 0;
54 }
55
56
57 int InsetHFill::plaintext(Buffer const &, odocstream & os,
58                       OutputParams const &) const
59 {
60         os << '\t';
61         return 0;
62 }
63
64
65 int InsetHFill::docbook(Buffer const &, std::ostream & os,
66                         OutputParams const &) const
67 {
68         os << '\n';
69         return 0;
70 }
71
72
73 void InsetHFill::write(Buffer const &, ostream & os) const
74 {
75         os << "\n\\hfill\n";
76 }
77
78
79 bool InsetHFill::isSpace() const
80 {
81         return true;
82 }