From 84e57fc918919a6fbd0bd05e4b898c129f27c48d Mon Sep 17 00:00:00 2001 From: haydentech Date: Mon, 10 Nov 2003 19:47:16 +0000 Subject: [PATCH] Fix line array bugs, missing breaks, gcc3 incompatibilities, and a few typos git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5301 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/View.cpp | 20 +++++----- src/kits/interface/Window.cpp | 73 ++++++++++++++++++----------------- 2 files changed, 46 insertions(+), 47 deletions(-) diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index 1b0446f630..6fae3218b7 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -191,12 +191,7 @@ BView::BView(BMessage *archive) SetEventMask( evMask, options ); } -/* -NOTE: this flag is not used any more - uint32 dBuf; - if ( archive->FindInt32("_dbuf", (int32*)&dBuf) == B_OK ){ - } -*/ + BPoint origin; if ( archive->FindPoint("_origin", &origin) == B_OK) SetOrigin( origin ); @@ -342,6 +337,8 @@ NOTE: we do not use this flag any more data->AddMessage( "_views", &childArchive ); } } + + return retval; } //--------------------------------------------------------------------------- @@ -679,7 +676,7 @@ void BView::SetFlags( uint32 flags ){ } } -/* Some usefull info: +/* Some useful info: fFlags is a unsigned long (32 bits) * bits 1-16 are used for BView's flags * bits 17-32 are used for BView' resize mask @@ -1804,7 +1801,7 @@ void BView:GetFont(BFont* font){ //--------------------------------------------------------------------------- void BView::GetFontHeight(font_height* height) const{ - return fState->font.GetHeight( height ); + fState->font.GetHeight( height ); } //--------------------------------------------------------------------------- @@ -2689,9 +2686,9 @@ void BView::AddLine(BPoint pt0, BPoint pt1, rgb_color col){ if (comm->count < comm->maxCount){ comm->array[ comm->count ].startX = pt0.x; - comm->array[ comm->count ].startX = pt0.y; + comm->array[ comm->count ].startY = pt0.y; comm->array[ comm->count ].endX = pt1.x; - comm->array[ comm->count ].endX = pt1.y; + comm->array[ comm->count ].endY = pt1.y; _set_ptr_rgb_color( &(comm->array[ comm->count ].color), col.red, col.green, col.blue, col.alpha ); @@ -2716,6 +2713,7 @@ void BView::EndLineArray(){ delete comm->array; delete comm; + comm = NULL; } } @@ -2950,7 +2948,7 @@ void BView::Invalidate(BRect invalRect){ owner->session->WriteInt32( AS_LAYER_INVAL_RECT ); owner->session->WriteRect( invalRect ); - // ... becasue we want to see the results ASAP + // ... because we want to see the results ASAP owner->session->Sync(); } } diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index 7af3e7734b..6d36275196 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -2227,14 +2227,15 @@ void BWindow::decomposeType(window_type type, case B_BORDERED_WINDOW: *look = B_BORDERED_WINDOW_LOOK; *feel = B_NORMAL_WINDOW_FEEL; - + break; case B_UNTYPED_WINDOW: *look = B_TITLED_WINDOW_LOOK; *feel = B_NORMAL_WINDOW_FEEL; - + break; default: *look = B_TITLED_WINDOW_LOOK; *feel = B_NORMAL_WINDOW_FEEL; + break; } } @@ -3202,21 +3203,21 @@ void BWindow::_ReservedWindow7() { } void BWindow::_ReservedWindow8() { } void BWindow::PrintToStream() const{ - printf("BWindow '%s' data: - Title = %s - Token = %ld - InTransaction = %s - Active = %s - fShowLevel = %d - Flags = %lx - send_port = %ld - receive_port = %ld - top_view name = %s - focus view name = %s - lastMouseMoved = %s - session = %s - KeyMenuBar name = %s - DefaultButton = %s + printf("BWindow '%s' data:\ + Title = %s\ + Token = %ld\ + InTransaction = %s\ + Active = %s\ + fShowLevel = %d\ + Flags = %lx\ + send_port = %ld\ + receive_port = %ld\ + top_view name = %s\ + focus view name = %s\ + lastMouseMoved = %s\ + session = %s\ + KeyMenuBar name = %s\ + DefaultButton = %s\ # of shortcuts = %ld", Name(), fTitle!=NULL? fTitle:"NULL", @@ -3241,25 +3242,25 @@ void BWindow::PrintToStream() const{ key->message->PrintToStream(); } */ - printf(" - topViewToken = %ld - pluseEnabled = %s - isFilePanel = %s - MaskActivated = %s - pulseRate = %lld - waitingForMenu = %s - minimized = %s - Menu semaphore = %ld - maxZoomHeight = %f - maxZoomWidth = %f - minWindHeight = %f - minWindWidth = %f - maxWindHeight = %f - maxWindWidth = %f - frame = ( %f, %f, %f, %f ) - look = %d - feel = %d - lastViewToken = %ld + printf("\ + topViewToken = %ld\ + pluseEnabled = %s\ + isFilePanel = %s\ + MaskActivated = %s\ + pulseRate = %lld\ + waitingForMenu = %s\ + minimized = %s\ + Menu semaphore = %ld\ + maxZoomHeight = %f\ + maxZoomWidth = %f\ + minWindHeight = %f\ + minWindWidth = %f\ + maxWindHeight = %f\ + maxWindWidth = %f\ + frame = ( %f, %f, %f, %f )\ + look = %d\ + feel = %d\ + lastViewToken = %ld\ pulseRUNNER = %s\n", fTopViewToken, fPulseEnabled==true?"Yes":"No",