Rename FontSpan::inside(pos) to contains(pos)

This commit is contained in:
Jean-Marc 2014-07-28 20:41:01 +02:00
parent 4843618655
commit fca332bace
3 changed files with 14 additions and 13 deletions

View File

@ -96,7 +96,7 @@ public:
///
void result(SpellChecker::Result r) { result_ = r; }
///
bool inside(pos_type pos) const { return range_.inside(pos); }
bool contains(pos_type pos) const { return range_.contains(pos); }
///
bool covered(FontSpan const & r) const
{
@ -104,8 +104,9 @@ public:
// 2. last of new range inside current range or
// 3. first of current range inside new range or
// 4. last of current range inside new range
return range_.inside(r.first) || range_.inside(r.last) ||
r.inside(range_.first) || r.inside(range_.last);
//FIXME: is this the same as !range_.intersect(r).empty() ?
return range_.contains(r.first) || range_.contains(r.last) ||
r.contains(range_.first) || r.contains(range_.last);
}
///
void shift(pos_type pos, int offset)
@ -191,7 +192,7 @@ public:
RangesIterator et = ranges_.end();
RangesIterator it = ranges_.begin();
for (; it != et; ++it) {
if(it->inside(pos)) {
if(it->contains(pos)) {
return it->result();
}
}
@ -205,7 +206,7 @@ public:
RangesIterator et = ranges_.end();
RangesIterator it = ranges_.begin();
for (; it != et; ++it) {
if(it->inside(pos)) {
if(it->contains(pos)) {
return it->range();
}
}

View File

@ -76,7 +76,7 @@ public:
return first == s.first && last == s.last;
}
inline bool inside(pos_type p) const
inline bool contains(pos_type p) const
{
return first <= p && p <= last;
}
@ -90,15 +90,15 @@ public:
inline FontSpan intersect(FontSpan const & f) const
{
FontSpan result = FontSpan();
if (inside(f.first))
if (contains(f.first))
result.first = f.first;
else if (f.inside(first))
else if (f.contains(first))
result.first = first;
else
return result;
if (inside(f.last))
if (contains(f.last))
result.last = f.last;
else if (f.inside(last))
else if (f.contains(last))
result.last = last;
return result;
}

View File

@ -183,7 +183,7 @@ void RowPainter::paintChars(pos_type & vpos, Font const & font)
for (++vpos ; vpos < end ; ++vpos) {
pos = bidi_.vis2log(vpos);
if (!font_span.inside(pos))
if (!font_span.contains(pos))
break;
bool const new_spell_state =
@ -736,13 +736,13 @@ void RowPainter::paintText()
}
// Use font span to speed things up, see above
if (!font_span.inside(pos)) {
if (!font_span.contains(pos)) {
font_span = par_.fontSpan(pos);
font = text_metrics_.displayFont(pit_, pos);
// split font span if inline completion is inside
if (inlineCompletionVPos != -1
&& font_span.inside(inlineCompletionPos.pos()))
&& font_span.contains(inlineCompletionPos.pos()))
font_span.last = inlineCompletionPos.pos();
}