]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.C
zlib stuff
[lyx.git] / src / rowpainter.C
index c95b9f7d073457fd46aca315b6ccea94bed1dacf..86bb5f5eb0180345eaed62de1746a6a8788c9b21 100644 (file)
@@ -131,7 +131,7 @@ RowPainter::RowPainter(BufferView const & bv, LyXText const & text,
      RowList::iterator rit,
      int y_offset, int x_offset, int y)
        : bv_(bv), pain_(bv_.painter()), text_(text), row_(rit),
-         pit_(rit->par()), 
+         pit_(rit->par()),
                xo_(x_offset), yo_(y_offset), y_(y)
 {}
 
@@ -139,7 +139,7 @@ RowPainter::RowPainter(BufferView const & bv, LyXText const & text,
 /// "temporary"
 LyXFont const RowPainter::getFont(pos_type pos) const
 {
-       return text_.getFont(bv_.buffer(), pit_, pos);
+       return text_.getFont(pit_, pos);
 }
 
 
@@ -157,7 +157,7 @@ int RowPainter::singleWidth(lyx::pos_type pos, char c) const
 
 LyXFont const RowPainter::getLabelFont() const
 {
-       return text_.getLabelFont(bv_.buffer(), pit_);
+       return text_.getLabelFont(pit_);
 }
 
 
@@ -175,7 +175,7 @@ int RowPainter::leftMargin() const
 
 void RowPainter::paintInset(pos_type const pos)
 {
-       Inset * inset = const_cast<Inset*>(pit_->getInset(pos));
+       InsetOld * inset = const_cast<InsetOld*>(pit_->getInset(pos));
 
        Assert(inset);
 
@@ -306,8 +306,8 @@ void RowPainter::paintChars(pos_type & vpos, bool hebrew, bool arabic)
        }
 
        // Draw text and set the new x position
-       lyxerr << "paint row: yo_ " << yo_ << " baseline: " << row_->baseline()
-               << "\n";
+       //lyxerr << "paint row: yo_ " << yo_ << " baseline: " << row_->baseline()
+       //      << "\n";
        pain_.text(int(x_), yo_ + row_->baseline(), str, orig_font);
        x_ += font_metrics::width(str, orig_font);
 }
@@ -1076,20 +1076,20 @@ void paintRows(BufferView const & bv, LyXText const & text,
        // calling metrics() directly is (a) slow and (b) crashs
        if (&text == bv.text) {
 #if 1
-               lyxerr << "paintRows, global...\n";
                // make sure all insets are updated
                ParagraphList::iterator pit = text.ownerParagraphs().begin();
                ParagraphList::iterator end = text.ownerParagraphs().end();
 
                // compute inset metrics
                for (; pit != end; ++pit) {
-                       for (int pos = 0; pos != pit->size(); ++pos) {
-                               if (pit->isInset(pos)) {
-                                       Dimension dim;
-                                       LyXFont font;
-                                       MetricsInfo mi(perv(bv), font, text.workWidth());
-                                       pit->getInset(pos)->metrics(mi, dim);
-                               }
+                       InsetList & insetList = pit->insetlist;
+                       InsetList::iterator ii = insetList.begin();
+                       InsetList::iterator iend = insetList.end();
+                       for (; ii != iend; ++ii) {
+                               Dimension dim;
+                               LyXFont font;
+                               MetricsInfo mi(perv(bv), font, text.workWidth());
+                               ii->inset->metrics(mi, dim);
                        }
                }
 #else