]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetpagebreak.C
hopefully fix tex2lyx linking.
[lyx.git] / src / insets / insetpagebreak.C
index c15d0702735ba3334384e43e388f0975133d3683..aab1690483033d54b86591967989f4b1f55cfde6 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * \file insetline.C
+ * \file insetpagebreak.C
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
 #include "metricsinfo.h"
 #include "gettext.h"
 
+#include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
-#include "frontends/font_metrics.h"
+
+
+namespace lyx {
+
+using frontend::Painter;
 
 using std::endl;
 using std::ostream;
@@ -33,7 +38,7 @@ void InsetPagebreak::read(Buffer const &, LyXLex &)
 
 void InsetPagebreak::write(Buffer const &, ostream & os) const
 {
-       os << "\n\\newpage \n";
+       os << "\n\\newpage\n";
 }
 
 
@@ -48,9 +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");
-       pi.pain.line(x, y, x + dim_.wid, y, LColor::topline, Painter::line_solid,
-                       Painter::line_thick);
+       static docstring const label = _("Page Break");
 
        LyXFont font;
        font.setColor(LColor::pagebreak);
@@ -59,7 +62,7 @@ void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
        int w = 0;
        int a = 0;
        int d = 0;
-       font_metrics::rectText(label, 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;
@@ -74,30 +77,28 @@ void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-int InsetPagebreak::latex(Buffer const &, ostream & os,
-                       LatexRunParams const &) const
+int InsetPagebreak::latex(Buffer const &, odocstream & os,
+                         OutputParams const &) const
 {
        os << "\\newpage{}";
        return 0;
 }
 
 
-int InsetPagebreak::ascii(Buffer const &, ostream & os, int) const
+int InsetPagebreak::plaintext(Buffer const &, odocstream & os,
+                         OutputParams const &) const
 {
-       os << "-------------------------------------------";
+       os << '\n';
        return 0;
 }
 
 
-int InsetPagebreak::linuxdoc(Buffer const &, std::ostream & os) const
+int InsetPagebreak::docbook(Buffer const &, odocstream & os,
+                           OutputParams const &) const
 {
        os << '\n';
        return 0;
 }
 
 
-int InsetPagebreak::docbook(Buffer const &, std::ostream & os, bool) const
-{
-       os << '\n';
-       return 0;
-}
+} // namespace lyx