]> git.lyx.org Git - lyx.git/blobdiff - src/screen.C
another pesky \#warning snuck in
[lyx.git] / src / screen.C
index 8a8f9d1f792cf13addc1563aadadabd147eb2f27..5ef3ad3aac364591c23dbe1fe1c0feed5030697c 100644 (file)
 #include "font.h"
 #include "insets/insettext.h"
 #include "ColorHandler.h"
+#include "language.h"
 
 using std::max;
 using std::min;
 
-static
+namespace {
+
 GC createGC()
 {
        XGCValues val;
@@ -45,6 +47,8 @@ GC createGC()
                         | GCLineWidth | GCLineStyle , &val);
 }
 
+} // namespace anon
+
 
 // Constructor
 LyXScreen::LyXScreen(WorkArea & o)
@@ -65,7 +69,7 @@ LyXScreen::LyXScreen(WorkArea & o)
 
 void LyXScreen::setCursorColor() 
 {
-       if (!lyxColorHandler) return;
+       if (!lyxColorHandler.get()) return;
 
        GC gc = lyxColorHandler->getGCForeground(LColor::cursor);
        
@@ -113,18 +117,13 @@ void LyXScreen::DrawFromTo(LyXText * text, BufferView * bv,
        // y1 is now the real beginning of row on the screen
        
        while (row != 0 && y < y2) {
-               LyXText::text_status st = text->status;
+               LyXText::text_status st = bv->text->status;
                do {
-                       text->status = st;
-#if 0
-                       text->GetVisibleRow(owner.owner(), y + y_offset,
-                                           x_offset, row, y + text->first);
-#else
+                       bv->text->status = st;
                        text->GetVisibleRow(bv, y + y_offset,
                                            x_offset, row, y + text->first);
-#endif
-               } while (text->status == LyXText::CHANGED_IN_DRAW);
-               text->status = st;
+               } while (bv->text->status == LyXText::CHANGED_IN_DRAW);
+               bv->text->status = st;
                y += row->height();
                row = row->next();
        }
@@ -148,18 +147,13 @@ void LyXScreen::DrawOneRow(LyXText * text, BufferView * bv, Row * row,
        if (((y + row->height()) > 0) &&
            ((y - row->height()) <= static_cast<int>(owner.height()))) {
                // ok there is something visible
-               LyXText::text_status st = text->status;
+               LyXText::text_status st = bv->text->status;
                do {
-                       text->status = st;
-#if 0
-                       text->GetVisibleRow(owner.owner(), y, x_offset, row,
-                                           y + text->first);
-#else
+                       bv->text->status = st;
                        text->GetVisibleRow(bv, y, x_offset, row,
                                            y + text->first);
-#endif
-               } while (text->status == LyXText::CHANGED_IN_DRAW);
-               text->status = st;
+               } while (bv->text->status == LyXText::CHANGED_IN_DRAW);
+               bv->text->status = st;
        }
        force_clear = false;
 }
@@ -224,17 +218,10 @@ void LyXScreen::ShowCursor(LyXText const * text, BufferView const * bv)
 {
        if (!cursor_visible) {
                Cursor_Shape shape = BAR_SHAPE;
-#if 0
-               if (text->real_current_font.language() !=
-                   owner.owner()->buffer()->params.language
-                   || text->real_current_font.isVisibleRightToLeft()
-                   != owner.owner()->buffer()->params.language->RightToLeft())
-#else
                if (text->real_current_font.language() !=
                    bv->buffer()->params.language
                    || text->real_current_font.isVisibleRightToLeft()
                    != bv->buffer()->params.language->RightToLeft())
-#endif
                        shape = (text->real_current_font.isVisibleRightToLeft())
                                ? REVERSED_L_SHAPE : L_SHAPE;
                ShowManualCursor(text, text->cursor.x(), text->cursor.y(),