From fca332bace10dfddd2d6fc6ea3889aea79b30c61 Mon Sep 17 00:00:00 2001 From: Jean-Marc Date: Mon, 28 Jul 2014 20:41:01 +0200 Subject: [PATCH] Rename FontSpan::inside(pos) to contains(pos) --- src/Paragraph.cpp | 11 ++++++----- src/Paragraph.h | 10 +++++----- src/RowPainter.cpp | 6 +++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index f8aeb33c91..eb239edbe0 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -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(); } } diff --git a/src/Paragraph.h b/src/Paragraph.h index ef99c9ffa4..c4d3f97681 100644 --- a/src/Paragraph.h +++ b/src/Paragraph.h @@ -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; } diff --git a/src/RowPainter.cpp b/src/RowPainter.cpp index 4f7e667e88..c42e82c207 100644 --- a/src/RowPainter.cpp +++ b/src/RowPainter.cpp @@ -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(); }