]> git.lyx.org Git - features.git/blobdiff - src/RowPainter.cpp
The way this was done here is inconsistent with how it is done
[features.git] / src / RowPainter.cpp
index ab42e675b4db590f0a7c1b22a13ae833ad7a9a53..1b7c33dcd215f90bc081fef3dc67498480866b96 100644 (file)
@@ -121,13 +121,15 @@ void RowPainter::paintInset(Inset const * inset, pos_type const pos)
        LASSERT(inset, return);
        // Backup full_repaint status because some insets (InsetTabular)
        // requires a full repaint
-       bool pi_full_repaint = pi_.full_repaint;
+       bool const pi_full_repaint = pi_.full_repaint;
+       bool const pi_do_spellcheck = pi_.do_spellcheck;
 
        pi_.base.font = inset->inheritFont() ? font.fontInfo() :
                pi_.base.bv->buffer().params().getFont().fontInfo();
        pi_.ltr_pos = (bidi_.level(pos) % 2 == 0);
        Change prev_change = change_;
        pi_.change_ = change_.changed() ? change_ : par_.lookupChange(pos);
+       pi_.do_spellcheck &= inset->allowSpellCheck();
 
        int const x1 = int(x_);
        pi_.base.bv->coordCache().insets().add(inset, x1, yo_);
@@ -147,6 +149,7 @@ void RowPainter::paintInset(Inset const * inset, pos_type const pos)
        // Restore full_repaint status.
        pi_.full_repaint = pi_full_repaint;
        pi_.change_ = prev_change;
+       pi_.do_spellcheck = pi_do_spellcheck;
 
 #ifdef DEBUG_METRICS
        int const x2 = x1 + dim.wid;
@@ -327,7 +330,7 @@ void RowPainter::paintFromPos(pos_type & vpos, bool changed)
                                --cpos;
                        new_word = par_.isSameSpellRange(pos, cpos) ;
                }
-               if (!new_word)
+               if (!new_word && pi_.do_spellcheck)
                        paintMisspelledMark(orig_x, changed);
        }
 }
@@ -439,6 +442,23 @@ int RowPainter::paintAppendixStart(int y)
 }
 
 
+void RowPainter::paintTooLargeMarks(bool const left, bool const right)
+{
+       if (left)
+               pi_.pain.line(int(dotted_line_thickness_), yo_ - row_.ascent(),
+                                         int(dotted_line_thickness_), yo_ + row_.descent(),
+                                         Color_scroll,
+                                         Painter::line_onoffdash, dotted_line_thickness_);
+       if (right) {
+               int const wwidth = pi_.base.bv->workWidth() - int(dotted_line_thickness_);
+               pi_.pain.line(wwidth, yo_ - row_.ascent(),
+                                         wwidth, yo_ + row_.descent(),
+                                         Color_scroll,
+                                         Painter::line_onoffdash, dotted_line_thickness_);
+       }
+}
+
+
 void RowPainter::paintFirst()
 {
        BufferParams const & bparams = pi_.base.bv->buffer().params();