]> git.lyx.org Git - features.git/blobdiff - src/rowpainter.C
* support/qstring_helpers.h: erase ucs4_to_qstring() method.
[features.git] / src / rowpainter.C
index b7e7761f302aa7a19ba76f93e87c43392fa4a6f2..294f8e5e4bc81a27f866f6b2017375a5f5611bc7 100644 (file)
@@ -301,6 +301,7 @@ void RowPainter::paintArabicComposeChar(pos_type & vpos, LyXFont const & font)
        pain_.text(int(x_) + dx, yo_, str, font);
 }
 
+
 void RowPainter::paintChars(pos_type & vpos, LyXFont const & font,
                            bool hebrew, bool arabic)
 {
@@ -346,6 +347,8 @@ void RowPainter::paintChars(pos_type & vpos, LyXFont const & font,
                str.push_back(c);
        }
 
+       docstring s(&str[0], str.size());
+
        if (prev_change != Change::UNCHANGED) {
                LyXFont copy(font);
                if (prev_change == Change::DELETED) {
@@ -353,9 +356,9 @@ void RowPainter::paintChars(pos_type & vpos, LyXFont const & font,
                } else if (prev_change == Change::INSERTED) {
                        copy.setColor(LColor::newtext);
                }
-               x_ += pain_.text(int(x_), yo_, &str[0], str.size(), copy);
+               x_ += pain_.text(int(x_), yo_, s, copy);
        } else {
-               x_ += pain_.text(int(x_), yo_, &str[0], str.size(), font);
+               x_ += pain_.text(int(x_), yo_, s, font);
        }
 }
 
@@ -977,7 +980,10 @@ void paintText(BufferView & bv,
        
        PainterInfo pi(const_cast<BufferView *>(&bv), pain);
        // Should the whole screen, including insets, be refreshed?
-       bool repaintAll = select || !vi.singlepar;
+       // FIXME: We should also distinguish DecorationUpdate to avoid text
+       // drawing if possible. This is not possible to do easily right now
+       // because of the single backing pixmap.
+       bool repaintAll = select || vi.update_strategy != SingleParUpdate;
 
        if (repaintAll) {
                // Clear background (if not delegated to rows)
@@ -1000,12 +1006,12 @@ void paintText(BufferView & bv,
 
        // and grey out above (should not happen later)
 //     lyxerr << "par ascent: " << text.getPar(vi.p1).ascent() << endl;
-       if (vi.y1 > 0 && !vi.singlepar)
+       if (vi.y1 > 0 && vi.update_strategy != SingleParUpdate)
                pain.fillRectangle(0, 0, bv.workWidth(), vi.y1, LColor::bottomarea);
 
        // and possibly grey out below
 //     lyxerr << "par descent: " << text.getPar(vi.p1).ascent() << endl;
-       if (vi.y2 < bv.workHeight() && !vi.singlepar)
+       if (vi.y2 < bv.workHeight() && vi.update_strategy != SingleParUpdate)
                pain.fillRectangle(0, vi.y2, bv.workWidth(), bv.workHeight() - vi.y2, LColor::bottomarea);
 }