]> git.lyx.org Git - features.git/commitdiff
Fix Qt crash
authorAngus Leeming <leeming@lyx.org>
Thu, 27 Feb 2003 09:39:24 +0000 (09:39 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 27 Feb 2003 09:39:24 +0000 (09:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6292 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/ChangeLog
src/frontends/screen.C

index cf5b5dfd95ae85c1e99ee7953213007a989a77de..6ab9d7357330ed7b2c9d857a64fa29bc08f007f6 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-27  Angus Leeming  <leeming@lyx.org>
+
+       * screen.C (redraw, greyOut): ensure that the painter is started
+       before attempting to paint.
+
 2003-02-26  John Levon  <levon@movementarian.org>
 
        * screen.C: use RowPainter
index 63075d9194fb62eb232c08bbf873866f962eb072..93f7064ef7503bda204930f8f543919b14e28052 100644 (file)
@@ -111,7 +111,7 @@ SplashScreen::SplashScreen()
 
 
 LyXScreen::LyXScreen()
-       : cursor_visible_(false), force_clear_(true), greyed_out_(false)
+       : cursor_visible_(false), force_clear_(true), greyed_out_(true)
 {
        // Start loading the pixmap as soon as possible
        if (lyxrc.show_banner) {
@@ -361,13 +361,13 @@ void LyXScreen::redraw(LyXText * text, BufferView * bv)
 {
        greyed_out_ = !text;
 
-       workarea().getPainter().start();
-
        if (greyed_out_) {
                greyOut();
                return;
        }
 
+       workarea().getPainter().start();
+
        drawFromTo(text, bv, 0, workarea().workHeight(), 0, 0, text == bv->text);
        expose(0, 0, workarea().workWidth(), workarea().workHeight());
 
@@ -385,6 +385,8 @@ void LyXScreen::greyOut()
        if (!greyed_out_)
                return;
 
+       workarea().getPainter().start();
+
        workarea().getPainter().fillRectangle(0, 0,
                workarea().workWidth(),
                workarea().workHeight(),