X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFontIterator.cpp;h=e104ca414d31a276ca8c8dd16571d64a2bb2d4a4;hb=5183c380b7c9a3b773b289e4e97a932f34a9f091;hp=c24cbce693eacf09fae699c1d060607f6b8a01ce;hpb=fc6ce7cd08562fd7bab4427880b46390bb7d2f07;p=lyx.git diff --git a/src/FontIterator.cpp b/src/FontIterator.cpp index c24cbce693..e104ca414d 100644 --- a/src/FontIterator.cpp +++ b/src/FontIterator.cpp @@ -9,23 +9,21 @@ * */ - #include #include "FontIterator.h" -#include "Buffer.h" -#include "LyXText.h" +#include "TextMetrics.h" #include "Paragraph.h" namespace lyx { -FontIterator::FontIterator(Buffer const & buffer, LyXText const & text, - Paragraph const & par, pos_type pos) - : buffer_(buffer), text_(text), par_(par), pos_(pos), - font_(text.getFont(buffer, par, pos)), +FontIterator::FontIterator(TextMetrics const & tm, + Paragraph const & par, pit_type pit, pos_type pos) + : tm_(tm), par_(par), pit_(pit), pos_(pos), + font_(tm.displayFont(pit, pos)), endspan_(par.fontSpan(pos).last), bodypos_(par.beginOfBody()) {} @@ -47,7 +45,7 @@ FontIterator & FontIterator::operator++() { ++pos_; if (pos_ > endspan_ || pos_ == bodypos_) { - font_ = text_.getFont(buffer_, par_, pos_); + font_ = tm_.displayFont(pit_, pos_); endspan_ = par_.fontSpan(pos_).last; } return *this;