]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.cpp
Workaround for #6865: smarter FontList::setMisspelled implementation
[lyx.git] / src / rowpainter.cpp
index 7f96ebc5cd2d5974081f7f136e757e41730ecf35..f767924dbe12897299dec821e4a460926d503f60 100644 (file)
@@ -330,7 +330,7 @@ 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);
+       pi_.pain.line(int(orig_x), y, int(x_), y, Color_red, Painter::line_onoffdash, Painter::line_thin);
 }
 
 
@@ -362,8 +362,8 @@ void RowPainter::paintFromPos(pos_type & vpos)
 
        paintForeignMark(orig_x, orig_font.language());
 
-       if (orig_font.isMisspelled())
-               paintMisspelledMark(orig_x, 3);
+       if (lyxrc.spellcheck_continuously && orig_font.isMisspelled())
+               paintMisspelledMark(orig_x, 2);
 }
 
 
@@ -680,13 +680,20 @@ void RowPainter::paintLast()
                FontInfo const font = labelFont();
                FontMetrics const & fm = theFontMetrics(font);
                docstring const & str = par_.layout().endlabelstring();
-               double const x = is_rtl ? 
-                       text_metrics_.width() - row_.width() - fm.width(str) : x_;
+               double const x = is_rtl ? x_ - fm.width(str) : x_;
                pi_.pain.text(int(x), yo_, str, font);
                break;
        }
 
        case END_LABEL_NO_LABEL:
+               if (lyxrc.paragraph_markers && size_type(pit_ + 1) < pars_.size()) {
+                       docstring const s = docstring(1, char_type(0x00B6));
+                       FontInfo f = FontInfo();
+                       FontMetrics const & fm = theFontMetrics(f);
+                       f.setColor(Color_paragraphmarker);
+                       pi_.pain.text(int(x_), yo_, s, f);
+                       x_ += fm.width(s);
+               }
                break;
        }
 }
@@ -709,7 +716,7 @@ void RowPainter::paintOnlyInsets()
                bool const pi_selected = pi_.selected;
                Cursor const & cur = pi_.base.bv->cursor();
                if (cur.selection() && cur.text() == &text_ 
-                         && cur.anchor().text() == &text_)
+                         && cur.normalAnchor().text() == &text_)
                        pi_.selected = row_.sel_beg <= pos && row_.sel_end > pos; 
                paintInset(inset, pos);
                pi_.selected = pi_selected;
@@ -851,7 +858,7 @@ void RowPainter::paintText()
                        bool const pi_selected = pi_.selected;
                        Cursor const & cur = pi_.base.bv->cursor();
                        if (cur.selection() && cur.text() == &text_ 
-                                 && cur.anchor().text() == &text_)
+                                 && cur.normalAnchor().text() == &text_)
                                pi_.selected = row_.sel_beg <= pos && row_.sel_end > pos; 
                        paintInset(inset, pos);
                        pi_.selected = pi_selected;