From: <usc...@us...> - 2008-06-22 09:08:34
|
Revision: 11815 http://jvcl.svn.sourceforge.net/jvcl/?rev=11815&view=rev Author: uschuster Date: 2008-06-21 03:59:03 -0700 (Sat, 21 Jun 2008) Log Message: ----------- fixed image loading for Delphi 5 (Mantis #4376) (Mantis #4376) Modified Paths: -------------- trunk/jvcl/run/JvDBImage.pas Modified: trunk/jvcl/run/JvDBImage.pas =================================================================== --- trunk/jvcl/run/JvDBImage.pas 2008-06-11 22:54:23 UTC (rev 11814) +++ trunk/jvcl/run/JvDBImage.pas 2008-06-21 10:59:03 UTC (rev 11815) @@ -167,6 +167,10 @@ end; procedure TJvDBImage.AssignGraphicTo(Picture: TPicture); +{$IFDEF COMPILER5} +type + TBitmapClass = class of TBitmap; +{$ENDIF COMPILER5} var Graphic: TGraphic; GraphicClass: TGraphicClass; @@ -191,6 +195,13 @@ // If we got one, load it.. if GraphicClass <> nil then begin + {$IFDEF COMPILER5} + // D5 workaround: somehow the overridden constructor is not called if + // GraphicClass is TGraphicClass + if GraphicClass.InheritsFrom(TBitmap) then + Graphic := TBitmapClass(GraphicClass).Create + else + {$ENDIF COMPILER5} Graphic := GraphicClass.Create; try Stream.Position := 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |