]> git.lyx.org Git - features.git/blobdiff - src/BufferView.cpp
Don't save background color in Text. Hand it down at drawing time.
[features.git] / src / BufferView.cpp
index 97e8d694cb39b6c6cf99054cd0ca0b23c627c3ab..a4185096250703965050569052e0f91350220276 100644 (file)
@@ -134,7 +134,7 @@ BufferView::BufferView(Buffer & buf)
 
        cursor_.push(buffer_.inset());
        cursor_.resetAnchor();
-       buffer_.text().setCurrentFont(cursor_);
+       cursor_.setCurrentFont();
 
        if (graphics::Previews::status() != LyXRC::PREVIEW_OFF)
                graphics::Previews::get().generateBufferPreviews(buffer_);
@@ -457,7 +457,7 @@ bool BufferView::moveToPosition(pit_type bottom_pit, pos_type bottom_pos,
                // Note: only bottom (document) level pit is set.
                setCursor(doc_it);
                // set the current font.
-               buffer_.text().setCurrentFont(cursor_);
+               cursor_.setCurrentFont();
                // center the screen on this new position.
                center();
        }
@@ -469,7 +469,7 @@ bool BufferView::moveToPosition(pit_type bottom_pit, pos_type bottom_pos,
 void BufferView::translateAndInsert(char_type c, Text * t, Cursor & cur)
 {
        if (lyxrc.rtl_support) {
-               if (cursor_.innerText()->real_current_font.isRightToLeft()) {
+               if (cursor_.real_current_font.isRightToLeft()) {
                        if (intl_->keymap == Intl::PRIMARY)
                                intl_->keyMapSec();
                } else {
@@ -1545,7 +1545,8 @@ void BufferView::draw(frontend::Painter & pain)
        if (pi.full_repaint)
                // Clear background (if not delegated to rows)
                pain.fillRectangle(0, metrics_info_.y1, width_,
-                       metrics_info_.y2 - metrics_info_.y1, text.backgroundColor());
+                       metrics_info_.y2 - metrics_info_.y1,
+                       buffer_.inset().backgroundColor());
 
        TextMetrics const & tm = text_metrics_[&text];