]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetnewline.C
Enable convertDefault.sh to run even if its executable bit is not set.
[lyx.git] / src / insets / insetnewline.C
index c7a3adeee96d45cd28c7d24b199d1fb3104f067a..eb7db91402833c2f44ba9a836b35166c33c8d7f7 100644 (file)
@@ -5,7 +5,7 @@
  *
  * \author John Levon
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 #include "paragraph.h"
 #include "lyxtext.h"
 #include "metricsinfo.h"
+#include "paragraph_funcs.h"
+
 #include "support/LOstream.h"
+
 #include "frontends/Painter.h"
 #include "frontends/font_metrics.h"
 
@@ -26,13 +29,13 @@ using std::ostream;
 using std::endl;
 
 
-void InsetNewline::read(Buffer const *, LyXLex &)
+void InsetNewline::read(Buffer const &, LyXLex &)
 {
        /* Nothing to read */
 }
 
 
-void InsetNewline::write(Buffer const *, ostream & os) const
+void InsetNewline::write(Buffer const &, ostream & os) const
 {
        os << "\n\\newline \n";
 }
@@ -44,10 +47,11 @@ void InsetNewline::metrics(MetricsInfo & mi, Dimension & dim) const
        dim.asc = font_metrics::maxAscent(font);
        dim.des = font_metrics::maxDescent(font);
        dim.wid = font_metrics::width('n', font);
+       dim_ = dim;
 }
 
 
-int InsetNewline::latex(Buffer const *, ostream &,
+int InsetNewline::latex(Buffer const &, ostream &,
                        LatexRunParams const &) const
 {
        lyxerr << "Eek, calling InsetNewline::latex !" << endl;
@@ -55,23 +59,23 @@ int InsetNewline::latex(Buffer const *, ostream &,
 }
 
 
-int InsetNewline::ascii(Buffer const *, ostream & os, int) const
+int InsetNewline::ascii(Buffer const &, ostream & os, int) const
 {
        os << '\n';
        return 0;
 }
 
 
-int InsetNewline::linuxdoc(Buffer const *, std::ostream &) const
+int InsetNewline::linuxdoc(Buffer const &, std::ostream & os) const
 {
-       /* FIXME */
+       os << '\n';
        return 0;
 }
 
 
-int InsetNewline::docbook(Buffer const *, std::ostream &, bool) const
+int InsetNewline::docbook(Buffer const &, std::ostream & os, bool) const
 {
-       /* FIXME */
+       os << '\n';
        return 0;
 }
 
@@ -82,7 +86,8 @@ void InsetNewline::draw(PainterInfo & pi, int x, int y) const
        int const asc = font_metrics::maxAscent(pi.base.font);
 
        // hack, and highly dubious
-       lyx::pos_type pos = parOwner()->getPositionOfInset(this);
+       lyx::pos_type pos = ownerPar(*pi.base.bv->buffer(), this)
+               .getPositionOfInset(this);
        bool const ltr_pos = (pi.base.bv->text->bidi_level(pos) % 2 == 0);
 
        int xp[3];