]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.C
LFUN_UNICODE_INSERT - unicode-insert
[lyx.git] / src / rowpainter.C
index ce48d1cd7400cb9fc527dac3d51480fd2760f167..7be384bfdff366361a7330603aaf53a59fcab058 100644 (file)
@@ -25,7 +25,6 @@
 #include "LColor.h"
 #include "lyxrc.h"
 #include "lyxrow.h"
-#include "lyxrow_funcs.h"
 #include "metricsinfo.h"
 #include "paragraph.h"
 #include "paragraph_funcs.h"
@@ -33,7 +32,6 @@
 #include "vspace.h"
 
 #include "frontends/FontMetrics.h"
-#include "frontends/nullpainter.h"
 #include "frontends/Painter.h"
 
 #include "insets/insettext.h"
@@ -46,7 +44,6 @@
 namespace lyx {
 
 using frontend::Painter;
-using frontend::NullPainter;
 using frontend::FontMetrics;
 
 using std::endl;
@@ -270,6 +267,7 @@ void RowPainter::paintChars(pos_type & vpos, LyXFont font,
        str += par_.getChar(pos);
 #else
        std::vector<char_type> str;
+       str.reserve(100);
        str.push_back(par_.getChar(pos));
 #endif
        if (arabic) {
@@ -724,7 +722,7 @@ void RowPainter::paintText()
 
                        pain_.line(int(x_), y1, int(x_), y0, LColor::added_space);
 
-                       if (hfillExpansion(par_, row_, pos)) {
+                       if (par_.hfillExpansion(row_, pos)) {
                                int const y2 = (y0 + y1) / 2;
 
                                if (pos >= body_pos) {
@@ -770,10 +768,10 @@ size_type calculateRowSignature(Row const & row, Paragraph const & par,
 {
        boost::crc_32_type crc;
        for (pos_type i = row.pos(); i < row.endpos(); ++i) {
-               const unsigned char b[] = { par.getChar(i) };
+               char_type const b[] = { par.getChar(i) };
                crc.process_bytes(b, 1);
        }
-       const unsigned char b[] = { x, y, row.width() };
+       char_type const b[] = { x, y, row.width() };
        crc.process_bytes(b, 3);
        return crc.checksum();
 }
@@ -820,8 +818,6 @@ void paintPar
         bool repaintAll)
 {
 //     lyxerr << "  paintPar: pit: " << pit << " at y: " << y << endl;
-       static NullPainter nop;
-       static PainterInfo nullpi(pi.base.bv, nop);
        int const ww = pi.base.bv->workHeight();
 
        pi.base.bv->coordCache().parPos()[&text][pit] = Point(x, y);
@@ -868,7 +864,7 @@ void paintPar
 
                        bool const inside = (y + rit->descent() >= 0
                                       && y - rit->ascent() < ww);
-                       RowPainter rp(inside ? pi : nullpi, text, pit, *rit, x, y);
+                       RowPainter rp(pi, text, pit, *rit, x, y);
                        // Clear background of this row
                        // (if paragraph background was not cleared)
                        if (!repaintAll &&