X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFontIterator.cpp;h=e104ca414d31a276ca8c8dd16571d64a2bb2d4a4;hb=9337d73f1f9a6d4dae2e239e9f679a7452660c40;hp=b14e29df2df634dc77c39f751fc4a3489b6b16ac;hpb=e0d54dd3b497b78094ea16ab0f38ccdc8c1642e2;p=lyx.git diff --git a/src/FontIterator.cpp b/src/FontIterator.cpp index b14e29df2d..e104ca414d 100644 --- a/src/FontIterator.cpp +++ b/src/FontIterator.cpp @@ -9,23 +9,21 @@ * */ - #include #include "FontIterator.h" -#include "Buffer.h" -#include "Text.h" +#include "TextMetrics.h" #include "Paragraph.h" namespace lyx { -FontIterator::FontIterator(Buffer const & buffer, Text 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;