]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetnewline.C
The speed patch: redraw only rows that have changed
[lyx.git] / src / insets / insetnewline.C
index 9b05ff477cf99a8a435b2e124049669d528857e6..239e2c2fd484cee51e0083341d7e5e29054d7163 100644 (file)
@@ -35,7 +35,7 @@ void InsetNewline::read(Buffer const &, LyXLex &)
 
 void InsetNewline::write(Buffer const &, ostream & os) const
 {
-       os << "\n\\newline \n";
+       os << "\n\\newline\n";
 }
 
 
@@ -86,11 +86,6 @@ void InsetNewline::draw(PainterInfo & pi, int x, int y) const
        int const wid = font_metrics::width('n', pi.base.font);
        int const asc = font_metrics::maxAscent(pi.base.font);
 
-       // hack, and highly dubious
-       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];
        int yp[3];
 
@@ -98,7 +93,7 @@ void InsetNewline::draw(PainterInfo & pi, int x, int y) const
        yp[1] = int(y - 0.500 * asc * 0.75);
        yp[2] = int(y - 0.125 * asc * 0.75);
 
-       if (ltr_pos) {
+       if (pi.ltr_pos) {
                xp[0] = int(x + wid * 0.375);
                xp[1] = int(x);
                xp[2] = int(x + wid * 0.375);
@@ -114,7 +109,7 @@ void InsetNewline::draw(PainterInfo & pi, int x, int y) const
        yp[1] = int(y - 0.500 * asc * 0.75);
        yp[2] = int(y - asc * 0.75);
 
-       if (ltr_pos) {
+       if (pi.ltr_pos) {
                xp[0] = int(x);
                xp[1] = int(x + wid);
                xp[2] = int(x + wid);