}
+void RowPainter::paintLanguageMarkings(Row::Element const & e) const
+{
+ paintForeignMark(e);
+ paintNoSpellingMark(e);
+}
+
+
void RowPainter::paintForeignMark(Row::Element const & e) const
{
Language const * lang = e.font.language();
return;
int const desc = e.inset ? e.dim.descent() : 0;
- int const y = yo_ + pi_.base.solidLineOffset()
- + desc + pi_.base.solidLineThickness() / 2;
- pi_.pain.line(int(x_), y, int(x_ + e.full_width()), y, Color_language,
+ int const y = yo_ + min(3 * pi_.base.solidLineOffset() / 2 + desc,
+ row_.descent() - 1);
+ pi_.pain.line(int(x_), y, int(x_ + e.full_width() - 1), y, Color_language,
Painter::line_solid, pi_.base.solidLineThickness());
}
+void RowPainter::paintNoSpellingMark(Row::Element const & e) const
+{
+ //if (!lyxrc.mark_no_spelling)
+ // return;
+ if (e.font.language() == latex_language)
+ return;
+ if (e.font.fontInfo().nospellcheck() != FONT_ON)
+ return;
+
+ // We at the same voffset than the misspelled mark, since
+ // these two are mutually exclusive
+ int const desc = e.inset ? e.dim.descent() : 0;
+ int const y = yo_ + pi_.base.solidLineOffset() + desc
+ + pi_.base.solidLineThickness()
+ + (e.change.changed() ? pi_.base.solidLineThickness() + 1 : 0)
+ + 1;
+ pi_.pain.line(int(x_), y, int(x_ + e.full_width()), y, Color_language,
+ Painter::line_onoffdash, pi_.base.solidLineThickness());
+}
+
+
void RowPainter::paintMisspelledMark(Row::Element const & e) const
{
+ if (e.font.fontInfo().nospellcheck() == FONT_ON)
+ return;
// if changed the misspelled marker gets placed slightly lower than normal
// to avoid drawing at the same vertical offset
FontMetrics const & fm = theFontMetrics(e.font);
void RowPainter::paintDepthBar() const
{
- depth_type depth = par_.getDepth();
-
- // We also mark follow-up paragraphs in a paragraph group
- if (par_.layout().isParagraphGroup()
- && par_.layout().labeltype == LABEL_STATIC
- && !text_.isFirstInSequence(row_.pit()))
- ++depth;
+ depth_type const depth = par_.getDepth();
if (depth <= 0)
return;
if (row_.pos() == 0)
--pit2;
prev_depth = pars_[pit2].getDepth();
- // We also mark follow-up paragraphs in a paragraph group
- if (pars_[pit2].layout().isParagraphGroup()
- && pars_[pit2].layout().labeltype == LABEL_STATIC
- && !text_.isFirstInSequence(pit2))
- ++prev_depth;
}
depth_type next_depth = 0;
if (row_.endpos() >= pars_[pit2].size())
++pit2;
next_depth = pars_[pit2].getDepth();
- // We also mark follow-up paragraphs in a paragraph group
- if (pars_[pit2].layout().isParagraphGroup()
- && pars_[pit2].layout().labeltype == LABEL_STATIC
- && !text_.isFirstInSequence(pit2))
- ++next_depth;
}
for (depth_type i = 1; i <= depth; ++i) {
Row::Element const & e = *cit;
if (e.type == Row::INSET) {
paintInset(e);
- // The line that indicates word in a different language
- paintForeignMark(e);
+ // The markings of foreign languages
+ // and of text ignored for spellchecking
+ paintLanguageMarkings(e);
// change tracking (not for insets that handle it themselves)
if (!e.inset->canPaintChange(*pi_.base.bv))
paintChange(e);
pi_.pain.textDecoration(e.font.fontInfo(), int(x_), yo_, int(e.full_width()));
}
- // The line that indicates word in a different language
- paintForeignMark(e);
+ // The markings of foreign languages
+ // and of text ignored for spellchecking
+ paintLanguageMarkings(e);
// change tracking (not for insets that handle it themselves)
if (e.type != Row::INSET || ! e.inset->canPaintChange(*pi_.base.bv))