]> git.lyx.org Git - features.git/blobdiff - src/RowPainter.cpp
New helper method Row::Element::isRTL()
[features.git] / src / RowPainter.cpp
index b8f91896004c8d414cc5851a088a3ae1cd6d98ff..81b58a869196347de68131440b010de0efeac193 100644 (file)
@@ -163,13 +163,6 @@ void RowPainter::paintInset(Inset const * inset, Font const & font,
 }
 
 
-void RowPainter::paintSeparator(double width, Font const & font)
-{
-       pi_.pain.textDecoration(font.fontInfo(), int(x_), yo_, int(width));
-       x_ += width;
-}
-
-
 void RowPainter::paintForeignMark(double orig_x, Language const * lang, int desc) const
 {
        if (!lyxrc.mark_foreign_language)
@@ -226,10 +219,10 @@ void RowPainter::paintMisspelledMark(double const orig_x,
 
                FontMetrics const & fm = theFontMetrics(e.font);
                int x1 = fm.pos2x(e.str, range.first - e.pos,
-                                 e.font.isVisibleRightToLeft(), e.extra);
+                                 e.isRTL(), e.extra);
                int x2 = fm.pos2x(e.str, min(range.last - e.pos + 1,
                                                                         pos_type(e.str.length())),
-                                                                        e.font.isVisibleRightToLeft(), e.extra);
+                                                                        e.isRTL(), e.extra);
                if (x1 > x2)
                        swap(x1, x2);
 
@@ -638,11 +631,9 @@ void RowPainter::paintText()
                case Row::VIRTUAL:
                        paintStringAndSel(e);
 
-                       // Paint the spelling mark if needed.
-                       if (lyxrc.spellcheck_continuously && pi_.do_spellcheck
-                               && par_.isMisspelled(e.pos)) {
+                       // Paint the spelling marks if enabled.
+                       if (lyxrc.spellcheck_continuously && pi_.do_spellcheck)
                                paintMisspelledMark(orig_x, e);
-                       }
                        break;
                case Row::INSET: {
                        // If outer row has changed, nested insets are repaint completely.
@@ -651,9 +642,9 @@ void RowPainter::paintText()
                        foreign_descent = e.dim.descent();
                }
                        break;
-               case Row::SEPARATOR:
                case Row::SPACE:
-                       paintSeparator(e.full_width(), e.font);
+                       pi_.pain.textDecoration(e.font.fontInfo(), int(x_), yo_, int(e.full_width()));
+                       x_ += e.full_width();
                }
 
                // The line that indicates word in a different language