From 3e3c4ddcceb6851b287fe5862810ad5ce98df826 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Mon, 6 Mar 2006 10:51:13 +0000 Subject: [PATCH] fFontHeight and fFontWidth weren't initialized in the TermView constructor, could cause some problems. Might fix bug 201, although I could never reproduce it consistently git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16598 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/terminal/TermView.cpp | 9 ++++++++- src/apps/terminal/TermView.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index 6565a6f526..196e250a33 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -123,6 +123,13 @@ TermView::TermView(BRect frame, CodeConv *inCodeConv) fViewThread = -1; fMouseThread = -1; fQuitting = 1; + + fFontHeight = 0; + fFontWidth = 0; + + // Set fonts to some defaults + SetTermFont(be_plain_font, be_plain_font); + InitViewThread(); fDrawRect_p = 0; @@ -213,7 +220,7 @@ TermView::SetTermColor() //! Sets half and full fonts for terminal void -TermView::SetTermFont(BFont *halfFont, BFont *fullFont) +TermView::SetTermFont(const BFont *halfFont, const BFont *fullFont) { char buf[4]; int halfWidth = 0; diff --git a/src/apps/terminal/TermView.h b/src/apps/terminal/TermView.h index fcb7f31e7a..55eabe66f3 100644 --- a/src/apps/terminal/TermView.h +++ b/src/apps/terminal/TermView.h @@ -105,7 +105,7 @@ public: // // Initializer, Set function // - void SetTermFont(BFont *halfFont, BFont *fullFont); + void SetTermFont(const BFont *halfFont, const BFont *fullFont); void GetFontSize (int *width, int *height); BRect SetTermSize (int rows, int cols, bool flag); void SetTermColor (void);