]> git.lyx.org Git - lyx.git/blobdiff - src/RowPainter.cpp
Add forgotten replacement
[lyx.git] / src / RowPainter.cpp
index 60bb5a741079c8f653d603b1262e4d19dd600441..a88ac2a6be39bd7a8bd2794aee1f9fdf6b2aaf6f 100644 (file)
@@ -429,14 +429,10 @@ void RowPainter::paintLabel() const
        Layout const & layout = par_.layout();
        FontInfo const font = labelFont(false);
        FontMetrics const & fm = theFontMetrics(font);
-       double x = x_;
-
-       if (row_.isRTL())
-               x = xo_ + tm_.width() - row_.right_margin + fm.width(layout.labelsep);
-       else
-               x = x_ - fm.width(layout.labelsep) - fm.width(str);
+       int const x = row_.isRTL() ? row_.width() + fm.width(layout.labelsep)
+                                  : row_.left_margin - fm.width(layout.labelsep) - fm.width(str);
 
-       pi_.pain.text(int(x), yo_, str, font);
+       pi_.pain.text(int(xo_) + x, yo_, str, font);
 }
 
 
@@ -511,30 +507,6 @@ static int getEndLabel(pit_type p, Text const & text)
 void RowPainter::paintLast() const
 {
        int const endlabel = getEndLabel(row_.pit(), text_);
-
-       // paint imaginary end-of-paragraph character
-
-       Change const & change = par_.lookupChange(par_.size());
-       if (change.changed()) {
-               FontMetrics const & fm =
-                       theFontMetrics(pi_.base.bv->buffer().params().getFont());
-               int const length = fm.maxAscent() / 2;
-               Color col = change.color();
-
-               pi_.pain.line(int(x_) + 1, yo_ + 2, int(x_) + 1, yo_ + 2 - length, col,
-                          Painter::line_solid, 3);
-
-               if (change.deleted()) {
-                       pi_.pain.line(int(x_) + 1 - length, yo_ + 2, int(x_) + 1 + length,
-                               yo_ + 2, col, Painter::line_solid, 3);
-               } else {
-                       pi_.pain.line(int(x_) + 1 - length, yo_ + 2, int(x_) + 1,
-                               yo_ + 2, col, Painter::line_solid, 3);
-               }
-       }
-
-       // draw an endlabel
-
        switch (endlabel) {
        case END_LABEL_BOX:
        case END_LABEL_FILLED_BOX: {
@@ -557,9 +529,9 @@ void RowPainter::paintLast() const
                }
 
                if (endlabel == END_LABEL_BOX)
-                       pi_.pain.rectangle(xo_ + x, y, size, size, font.realColor());
+                       pi_.pain.rectangle(int(xo_) + x, y, size, size, font.realColor());
                else
-                       pi_.pain.fillRectangle(xo_ + x, y, size, size, font.realColor());
+                       pi_.pain.fillRectangle(int(xo_) + x, y, size, size, font.realColor());
                break;
        }
 
@@ -580,10 +552,7 @@ void RowPainter::paintLast() const
 
 void RowPainter::paintOnlyInsets()
 {
-       Row::const_iterator cit = row_.begin();
-       Row::const_iterator const & end = row_.end();
-       for ( ; cit != end ; ++cit) {
-               Row::Element const & e = *cit;
+       for (Row::Element const & e : row_) {
                if (e.type == Row::INSET) {
                        paintInset(e);
                        // The markings of foreign languages
@@ -601,11 +570,7 @@ void RowPainter::paintOnlyInsets()
 
 void RowPainter::paintText()
 {
-       Row::const_iterator cit = row_.begin();
-       Row::const_iterator const & end = row_.end();
-       for ( ; cit != end ; ++cit) {
-               Row::Element const & e = *cit;
-
+       for (Row::Element const & e : row_) {
                switch (e.type) {
                case Row::STRING:
                case Row::VIRTUAL: