]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.C
Point fix, earlier forgotten
[lyx.git] / src / rowpainter.C
index f90f0f2cbf3b41fa40b6295f1be8d2bb6b72dafb..a59e8385bbda8be267fc7b6cb4aaada930b43ce6 100644 (file)
@@ -691,22 +691,22 @@ void RowPainter::paintFirst()
        y_top += paintLengthMarker(_("Space above"), parparams.spaceTop(),
                        yo_ + y_top);
 
-       Buffer const * buffer = bv_.buffer();
+       Buffer const & buffer = *bv_.buffer();
 
        LyXLayout_ptr const & layout = pit_->layout();
 
-       if (buffer->params.paragraph_separation == BufferParams::PARSEP_SKIP) {
+       if (buffer.params.paragraph_separation == BufferParams::PARSEP_SKIP) {
                if (pit_ != text_.ownerParagraphs().begin()) {
                        if (layout->latextype == LATEX_PARAGRAPH
                                && !pit_->getDepth()) {
-                               y_top += buffer->params.getDefSkip().inPixels(bv_);
+                               y_top += buffer.params.getDefSkip().inPixels(bv_);
                        } else {
                                LyXLayout_ptr const & playout =
                                        boost::prior(pit_)->layout();
                                if (playout->latextype == LATEX_PARAGRAPH
                                        && !boost::prior(pit_)->getDepth()) {
                                        // is it right to use defskip here, too? (AS)
-                                       y_top += buffer->params.getDefSkip().inPixels(bv_);
+                                       y_top += buffer.params.getDefSkip().inPixels(bv_);
                                }
                        }
                }
@@ -746,12 +746,12 @@ void RowPainter::paintFirst()
                        // printed in an extra row and has a pagebreak at
                        // the top.
                        if (layout->labeltype == LABEL_COUNTER_CHAPTER) {
-                               if (buffer->params.secnumdepth >= 0) {
+                               if (buffer.params.secnumdepth >= 0) {
                                        float spacing_val = 1.0;
                                        if (!parparams.spacing().isDefault()) {
                                                spacing_val = parparams.spacing().getValue();
                                        } else {
-                                               spacing_val = buffer->params.spacing.getValue();
+                                               spacing_val = buffer.params.spacing.getValue();
                                        }
 
                                        int const maxdesc =
@@ -794,7 +794,7 @@ void RowPainter::paintFirst()
                        if (!parparams.spacing().isDefault()) {
                                spacing_val = parparams.spacing().getValue();
                        } else {
-                               spacing_val = buffer->params.spacing.getValue();
+                               spacing_val = buffer.params.spacing.getValue();
                        }
 
                        int maxdesc =
@@ -1046,11 +1046,11 @@ int paintRows(BufferView const & bv, LyXText const & text,
        ParagraphList::iterator pit, RowList::iterator rit,
        int xo, int y, int yf, int yo)
 {
-       lyxerr << "  paintRows: rit: " << &*rit << endl;
+       //lyxerr << "  paintRows: rit: " << &*rit << endl;
        //const_cast<LyXText&>(text).updateRowPositions();
        int const yy = yf - y;
        int const y2 = bv.painter().paperHeight();
-       
+
        ParagraphList::iterator end = text.ownerParagraphs().end();
        bool active = false;
 
@@ -1062,7 +1062,7 @@ int paintRows(BufferView const & bv, LyXText const & text,
                        if (row == rit)
                                active = true;
                        if (active) {
-                               RowPainter painter(bv, text, pit, row, y + yo, xo, y + text.top_y());
+                               RowPainter painter(bv, text, pit, row, y + yo, xo, y + bv.top_y());
                                painter.paint();
                                y += row->height();
                                if (yy + y >= y2)
@@ -1076,17 +1076,16 @@ int paintRows(BufferView const & bv, LyXText const & text,
        return y;
 }
 
-
 } // namespace anon
 
 
-int paintText(BufferView & bv, LyXText & text)
+int paintText(BufferView & bv)
 {
-       int const topy = text.top_y();
+       int const topy = bv.top_y();
        ParagraphList::iterator pit;
-       RowList::iterator rit = text.getRowNearY(topy, pit);
+       RowList::iterator rit = bv.text->getRowNearY(topy, pit);
        int y = rit->y() - topy;
-       return paintRows(bv, text, pit, rit, 0, y, y, 0);
+       return paintRows(bv, *bv.text, pit, rit, 0, y, y, 0);
 }
 
 
@@ -1102,13 +1101,10 @@ void paintTextInset(BufferView & bv, LyXText & text, int x, int baseline)
                y += rit->height();
                text.nextRow(pit, rit);
        }
-       if (y_offset < 0) {
-               text.top_y(-y_offset);
+       if (y_offset < 0)
                paintRows(bv, text, pit, rit, x, 0, y, y);
-       } else {
-               text.top_y(y - y_offset);
+       else
                paintRows(bv, text, pit, rit, x, 0, y_offset, y_offset);
-       }
 }
 
 
@@ -1131,5 +1127,3 @@ int getLengthMarkerHeight(BufferView const & bv, VSpace const & vsp)
        else
                return max(min_size, space_size);
 }
-
-