]> git.lyx.org Git - lyx.git/blobdiff - src/FontIterator.cpp
Comment.
[lyx.git] / src / FontIterator.cpp
index b14e29df2df634dc77c39f751fc4a3489b6b16ac..e104ca414d31a276ca8c8dd16571d64a2bb2d4a4 100644 (file)
@@ -9,23 +9,21 @@
  *
  */
 
-
 #include <config.h>
 
 #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;