From 5f79f11b3db5faed9f3267d16f450249cf100a0a Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 30 Jun 2003 17:25:26 +0000 Subject: [PATCH] fixed parsing of with do try finally end git-svn-id: trunk@4347 - --- components/codetools/pascalparsertool.pas | 2 +- lcl/graphics.pp | 4 ++++ lcl/include/bitmap.inc | 20 ++++---------------- lcl/include/bitmapimage.inc | 21 +++++++++++++++++++++ 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/components/codetools/pascalparsertool.pas b/components/codetools/pascalparsertool.pas index 82f41f6c9f..a8b73ebf92 100644 --- a/components/codetools/pascalparsertool.pas +++ b/components/codetools/pascalparsertool.pas @@ -2080,7 +2080,7 @@ begin if BlockStatementStartKeyWordFuncList.DoItUppercase(UpperSrc,CurPos.StartPos, CurPos.EndPos-CurPos.StartPos) then begin - if not ReadTilBlockEnd(ExceptionOnError,CreateNodes) then exit; + if not ReadTilBlockEnd(false,CreateNodes) then exit; ReadNextAtom; if CurPos.Flag<>cafSemicolon then UndoReadNextAtom; end else if UpAtomIs('WITH') then begin diff --git a/lcl/graphics.pp b/lcl/graphics.pp index b21d4225e9..1bd38f1e8a 100644 --- a/lcl/graphics.pp +++ b/lcl/graphics.pp @@ -659,6 +659,7 @@ type procedure FreeHandle; override; function ReleaseHandle: HBITMAP; function IsEmpty: boolean; + function GetPixelFormat: TPixelFormat; public FDIB: TDIBSection; destructor Destroy; override; @@ -1030,6 +1031,9 @@ end. { ============================================================================= $Log$ + Revision 1.74 2003/06/30 17:25:26 mattias + fixed parsing of with do try finally end + Revision 1.73 2003/06/30 16:31:04 mattias fixed find declaration of with A,B do C; statements diff --git a/lcl/include/bitmap.inc b/lcl/include/bitmap.inc index 09598d2be9..e2f87443f9 100644 --- a/lcl/include/bitmap.inc +++ b/lcl/include/bitmap.inc @@ -165,22 +165,7 @@ end; procedure TBitmap.UpdatePixelFormat; begin - FPixelFormat := pfCustom; - if HandleType = bmDDB then - FPixelFormat := pfDevice - else - with FImage.FDIB, dsbmih do - case biBitCount of - 1: FPixelFormat := pf1Bit; - 4: FPixelFormat := pf4Bit; - 8: FPixelFormat := pf8Bit; - 16: case biCompression of - BI_RGB : FPixelFormat := pf15Bit; - BI_BITFIELDS: if dsBitFields[1] = $7E0 then FPixelFormat := pf16Bit; - end; - 24: FPixelFormat := pf24Bit; - 32: if biCompression = BI_RGB then FPixelFormat := pf32Bit; - end; + FPixelFormat := FImage.GetPixelFormat; end; procedure TBitmap.Changed(Sender: TObject); @@ -731,6 +716,9 @@ end; { ============================================================================= $Log$ + Revision 1.36 2003/06/30 17:25:26 mattias + fixed parsing of with do try finally end + Revision 1.35 2003/06/30 16:31:04 mattias fixed find declaration of with A,B do C; statements diff --git a/lcl/include/bitmapimage.inc b/lcl/include/bitmapimage.inc index b06db3d451..da1bd282e4 100644 --- a/lcl/include/bitmapimage.inc +++ b/lcl/include/bitmapimage.inc @@ -90,5 +90,26 @@ begin Result := (FHandle = 0) and (FDIBHandle = 0); end; +function TBitmapImage.GetPixelFormat: TPixelFormat; +begin + Result:=pfCustom; + if GetHandleType = bmDDB then + Result := pfDevice + else + case FDIB.dsBmih.biBitCount of + 1: Result := pf1Bit; + 4: Result := pf4Bit; + 8: Result := pf8Bit; + 16: case FDIB.dsBmih.biCompression of + BI_RGB : Result := pf15Bit; + BI_BITFIELDS: if FDIB.dsBitFields[1] = $7E0 then + Result := pf16Bit; + end; + 24: Result := pf24Bit; + 32: if FDIB.dsBmih.biCompression = BI_RGB then + Result := pf32Bit; + end; +end; + // included by graphics.pp