]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.C
cleanup after svn hang-up, #undef CursorShape. Should be compilable ganin now.
[lyx.git] / src / rowpainter.C
index 45bae7438c8b98a0d038623f75ad8f8d609a3e18..9d3593092b95a9c7e44b7fc6a94ea1b9c2e83c74 100644 (file)
@@ -457,7 +457,7 @@ int RowPainter::paintAppendixStart(int y)
        pb_font.setColor(LColor::appendix);
        pb_font.decSize();
 
-       string const label = _("Appendix");
+       string const label = lyx::to_utf8(_("Appendix"));
        int w = 0;
        int a = 0;
        int d = 0;
@@ -910,7 +910,7 @@ void paintPar
 void paintText(BufferView const & bv, ViewMetricsInfo const & vi,
               Painter & pain)
 {
-       LyXText * const text = bv.text();
+       LyXText & text = bv.buffer()->text();
        bool const select = bv.cursor().selection();
 
        PainterInfo pi(const_cast<BufferView *>(&bv), pain);
@@ -920,19 +920,19 @@ void paintText(BufferView const & bv, ViewMetricsInfo const & vi,
        if (repaintAll) {
                // Clear background (if not delegated to rows)
                pain.fillRectangle(0, vi.y1, bv.workWidth(), vi.y2 - vi.y1,
-                       text->backgroundColor());
+                       text.backgroundColor());
        }
        if (select) {
-               text->drawSelection(pi, 0, 0);
+               text.drawSelection(pi, 0, 0);
        }
 
        int yy = vi.y1;
        // draw contents
        for (pit_type pit = vi.p1; pit <= vi.p2; ++pit) {
                refreshInside = repaintAll;
-               Paragraph const & par = text->getPar(pit);
+               Paragraph const & par = text.getPar(pit);
                yy += par.ascent();
-               paintPar(pi, *bv.text(), pit, 0, yy, repaintAll);
+               paintPar(pi, text, pit, 0, yy, repaintAll);
                yy += par.descent();
        }
 
@@ -941,24 +941,24 @@ void paintText(BufferView const & bv, ViewMetricsInfo const & vi,
        // Try viewing the User Guide Mobius figure
 
        if (vi.p1 > 0) {
-               text->redoParagraph(vi.p1 - 1);
-               theCoords.parPos()[bv.text()][vi.p1 - 1] =
-                       Point(0, vi.y1 - text->getPar(vi.p1 - 1).descent());
+               text.redoParagraph(vi.p1 - 1);
+               theCoords.parPos()[&text][vi.p1 - 1] =
+                       Point(0, vi.y1 - text.getPar(vi.p1 - 1).descent());
        }
 
-       if (vi.p2 < lyx::pit_type(text->paragraphs().size()) - 1) {
-               text->redoParagraph(vi.p2 + 1);
-               theCoords.parPos()[bv.text()][vi.p2 + 1] =
-                       Point(0, vi.y2 + text->getPar(vi.p2 + 1).ascent());
+       if (vi.p2 < lyx::pit_type(text.paragraphs().size()) - 1) {
+               text.redoParagraph(vi.p2 + 1);
+               theCoords.parPos()[&text][vi.p2 + 1] =
+                       Point(0, vi.y2 + text.getPar(vi.p2 + 1).ascent());
        }
 
        // and grey out above (should not happen later)
-//     lyxerr << "par ascent: " << text->getPar(vi.p1).ascent() << endl;
+//     lyxerr << "par ascent: " << text.getPar(vi.p1).ascent() << endl;
        if (vi.y1 > 0 && !vi.singlepar)
                pain.fillRectangle(0, 0, bv.workWidth(), vi.y1, LColor::bottomarea);
 
        // and possibly grey out below
-//     lyxerr << "par descent: " << text->getPar(vi.p1).ascent() << endl;
+//     lyxerr << "par descent: " << text.getPar(vi.p1).ascent() << endl;
        if (vi.y2 < bv.workHeight() && !vi.singlepar)
                pain.fillRectangle(0, vi.y2, bv.workWidth(), bv.workHeight() - vi.y2, LColor::bottomarea);
 }