]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.cpp
Fix http://bugzilla.lyx.org/show_bug.cgi?id=5021
[lyx.git] / src / rowpainter.cpp
index 8ef3b6f310a67bcd8a357d554d9250ad766648dc..45552501442fc01e01af3b1cc66f81e1f76382c5 100644 (file)
@@ -312,12 +312,12 @@ void RowPainter::paintChars(pos_type & vpos, FontInfo const & font,
        }
        
        FontInfo copy = font;
-       if (selection)
-               copy.setColor(Color_selectiontext);
-       else if (change_type == Change::DELETED)
+       if (change_type == Change::DELETED)
                copy.setColor(Color_deletedtext);
        else if (change_type == Change::INSERTED)
                copy.setColor(Color_addedtext);
+       else if (selection)
+               copy.setColor(Color_selectiontext);
 
        x_ += pi_.pain.text(int(x_), yo_, s, copy);
 }
@@ -338,6 +338,13 @@ void RowPainter::paintForeignMark(double orig_x, Language const * lang,
 }
 
 
+void RowPainter::paintMisspelledMark(double orig_x, int desc)
+{
+       int const y = yo_ + desc;
+       pi_.pain.wavyHorizontalLine(int(orig_x), y, int(x_) - int(orig_x), Color_red);
+}
+
+
 void RowPainter::paintFromPos(pos_type & vpos)
 {
        pos_type const pos = bidi_.vis2log(vpos);
@@ -365,6 +372,8 @@ void RowPainter::paintFromPos(pos_type & vpos)
        }
 
        paintForeignMark(orig_x, orig_font.language());
+       if (orig_font.isMisspelled())
+               paintMisspelledMark(orig_x, 3);
 }