]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.cpp
Do not use \&@#^_~$ as lstinline delimiter, as suggested by Herbert
[lyx.git] / src / rowpainter.cpp
index 98dac6738e76f32782f8769fc04c3f5aa8668276..1d17a3b5acbf63a70ba43d0d4d41153b256a6de0 100644 (file)
@@ -65,7 +65,7 @@ bool refreshInside;
 class RowPainter {
 public:
        /// initialise and run painter
-       RowPainter(PainterInfo & pi, LyXText const & text,
+       RowPainter(PainterInfo & pi, Text const & text,
                pit_type pit, Row const & row, int x, int y);
 
        // paint various parts
@@ -99,8 +99,8 @@ private:
        /// Painter to use
        Painter & pain_;
 
-       /// LyXText for the row
-       LyXText const & text_;
+       /// Text for the row
+       Text const & text_;
        TextMetrics & text_metrics_;
        ParagraphList const & pars_;
 
@@ -128,7 +128,7 @@ private:
 
 
 RowPainter::RowPainter(PainterInfo & pi,
-       LyXText const & text, pit_type pit, Row const & row, int x, int y)
+       Text const & text, pit_type pit, Row const & row, int x, int y)
        : bv_(*pi.base.bv), pain_(pi.pain), text_(text),
          text_metrics_(pi.base.bv->textMetrics(&text)),
          pars_(text.paragraphs()),
@@ -368,9 +368,9 @@ void RowPainter::paintChars(pos_type & vpos, Font const & font,
        if (prev_change != Change::UNCHANGED) {
                Font copy(font);
                if (prev_change == Change::DELETED) {
-                       copy.setColor(Color::strikeout);
+                       copy.setColor(Color::deletedtext);
                } else if (prev_change == Change::INSERTED) {
-                       copy.setColor(Color::newtext);
+                       copy.setColor(Color::addedtext);
                }
                x_ += pain_.text(int(x_), yo_, s, copy);
        } else {
@@ -669,7 +669,7 @@ void RowPainter::paintLast()
        if (par_.isInserted(par_.size()) || par_.isDeleted(par_.size())) {
                FontMetrics const & fm = theFontMetrics(bv_.buffer()->params().getFont());
                int const length = fm.maxAscent() / 2;
-               Color::color col = par_.isInserted(par_.size()) ? Color::newtext : Color::strikeout;
+               Color::color col = par_.isInserted(par_.size()) ? Color::addedtext : Color::deletedtext;
                
                pain_.line(int(x_) + 1, yo_ + 2, int(x_) + 1, yo_ + 2 - length, col,
                           Painter::line_solid, Painter::line_thick);
@@ -779,7 +779,7 @@ void RowPainter::paintText()
                                = theFontMetrics(bv_.buffer()->params().getFont());
                        int const middle = yo_ - fm.maxAscent() / 3;
                        pain_.line(last_strikeout_x, middle, int(x_), middle,
-                               Color::strikeout, Painter::line_solid, Painter::line_thin);
+                               Color::deletedtext, Painter::line_solid, Painter::line_thin);
                        running_strikeout = false;
                }
 
@@ -818,10 +818,13 @@ void RowPainter::paintText()
                        x_ += 2;
                        ++vpos;
                } else if (par_.isSeparator(pos)) {
+                       Font orig_font = text_.getFont(*bv_.buffer(), par_, pos);
+                       double const orig_x = x_;
                        x_ += width_pos;
                        if (pos >= body_pos)
                                x_ += separator_;
                        ++vpos;
+                       paintForeignMark(orig_x, orig_font);
                } else {
                        paintFromPos(vpos);
                }
@@ -834,14 +837,14 @@ void RowPainter::paintText()
                        = theFontMetrics(bv_.buffer()->params().getFont());
                int const middle = yo_ - fm.maxAscent() / 3;
                pain_.line(last_strikeout_x, middle, int(x_), middle,
-                       Color::strikeout, Painter::line_solid, Painter::line_thin);
+                       Color::deletedtext, Painter::line_solid, Painter::line_thin);
                running_strikeout = false;
        }
 }
 
 
 bool CursorOnRow(PainterInfo & pi, pit_type const pit,
-       RowList::const_iterator rit, LyXText const & text)
+       RowList::const_iterator rit, Text const & text)
 {
        // Is there a cursor on this row (or inside inset on row)
        Cursor & cur = pi.base.bv->cursor();
@@ -858,7 +861,7 @@ bool CursorOnRow(PainterInfo & pi, pit_type const pit,
 
 
 bool innerCursorOnRow(PainterInfo & pi, pit_type pit,
-       RowList::const_iterator rit, LyXText const & text)
+       RowList::const_iterator rit, Text const & text)
 {
        // Is there a cursor inside an inset on this row, and is this inset
        // the only "character" on this row
@@ -895,7 +898,7 @@ bool inNarrowInset(PainterInfo & pi)
 
 
 void paintPar
-       (PainterInfo & pi, LyXText const & text, pit_type pit, int x, int y,
+       (PainterInfo & pi, Text const & text, pit_type pit, int x, int y,
         bool repaintAll)
 {
 //     lyxerr << "  paintPar: pit: " << pit << " at y: " << y << endl;
@@ -1009,7 +1012,7 @@ void paintText(BufferView & bv,
 {
        BOOST_ASSERT(bv.buffer());
        Buffer const & buffer = *bv.buffer();
-       LyXText & text = buffer.text();
+       Text & text = buffer.text();
        bool const select = bv.cursor().selection();
        ViewMetricsInfo const & vi = bv.viewMetricsInfo();
        
@@ -1051,7 +1054,7 @@ void paintText(BufferView & bv,
 }
 
 
-void paintTextInset(LyXText const & text, PainterInfo & pi, int x, int y)
+void paintTextInset(Text const & text, PainterInfo & pi, int x, int y)
 {
 //     lyxerr << "  paintTextInset: y: " << y << endl;