]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetpagebreak.C
hopefully fix tex2lyx linking.
[lyx.git] / src / insets / insetpagebreak.C
index ff11d0f367b28bcaae7ecf76e404fa297a003831..aab1690483033d54b86591967989f4b1f55cfde6 100644 (file)
 #include "metricsinfo.h"
 #include "gettext.h"
 
+#include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
-#include "frontends/font_metrics.h"
 
-using lyx::docstring;
-using lyx::frontend::Painter;
+
+namespace lyx {
+
+using frontend::Painter;
 
 using std::endl;
 using std::ostream;
@@ -51,7 +53,7 @@ void InsetPagebreak::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
 {
-       static std::string const label = _("Page Break");
+       static docstring const label = _("Page Break");
 
        LyXFont font;
        font.setColor(LColor::pagebreak);
@@ -60,13 +62,12 @@ void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
        int w = 0;
        int a = 0;
        int d = 0;
-        docstring dlab(label.begin(), label.end());
-       font_metrics::rectText(dlab, font, w, a, d);
+       theFontMetrics(font).rectText(label, w, a, d);
 
        int const text_start = int(x + (dim_.wid - w) / 2);
        int const text_end = text_start + w;
 
-       pi.pain.rectText(text_start, y + d, dlab, font,
+       pi.pain.rectText(text_start, y + d, label, font,
                LColor::none, LColor::none);
 
        pi.pain.line(x, y, text_start, y,
@@ -76,7 +77,7 @@ void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-int InsetPagebreak::latex(Buffer const &, ostream & os,
+int InsetPagebreak::latex(Buffer const &, odocstream & os,
                          OutputParams const &) const
 {
        os << "\\newpage{}";
@@ -84,7 +85,7 @@ int InsetPagebreak::latex(Buffer const &, ostream & os,
 }
 
 
-int InsetPagebreak::plaintext(Buffer const &, ostream & os,
+int InsetPagebreak::plaintext(Buffer const &, odocstream & os,
                          OutputParams const &) const
 {
        os << '\n';
@@ -92,17 +93,12 @@ int InsetPagebreak::plaintext(Buffer const &, ostream & os,
 }
 
 
-int InsetPagebreak::linuxdoc(Buffer const &, std::ostream & os,
-                            OutputParams const &) const
+int InsetPagebreak::docbook(Buffer const &, odocstream & os,
+                           OutputParams const &) const
 {
        os << '\n';
        return 0;
 }
 
 
-int InsetPagebreak::docbook(Buffer const &, std::ostream & os,
-                           OutputParams const &) const
-{
-       os << '\n';
-       return 0;
-}
+} // namespace lyx