From: <sr...@us...> - 2006-02-25 00:10:40
|
Revision: 626 Author: srmitch Date: 2006-02-24 16:10:30 -0800 (Fri, 24 Feb 2006) ViewCVS: http://svn.sourceforge.net/instantobjects?rev=626&view=rev Log Message: ----------- Fixes for bugs: #1430106 - TInstantBlobAttribute.Assign doesn't work properly because LoadDataFromStream doesn't clear stream. #1410143 - When an EditForm of a Person with image that was just edited is opened, Primer raises an exception with message "Unsupported graphic stream format", "Metafile is not valid" or "Stream read error". Always inside TInstantBlob.AssignToPicture procedure (InstantPersistence unit). Modified Paths: -------------- trunk/Source/Core/InstantPersistence.pas trunk/Source/Core/InstantPresentation.pas Modified: trunk/Source/Core/InstantPersistence.pas =================================================================== --- trunk/Source/Core/InstantPersistence.pas 2006-02-23 18:33:19 UTC (rev 625) +++ trunk/Source/Core/InstantPersistence.pas 2006-02-25 00:10:30 UTC (rev 626) @@ -3120,7 +3120,7 @@ else if (p[0] = #$47) and (p[1] = #$49) and (p[2] = #$46) then Result := gffGif; finally AStream.Position := 0; - end; + end; finally Freemem( p ); end; @@ -5790,8 +5790,7 @@ begin if not Assigned(AStream) then Exit; - Stream.Clear; - Stream.CopyFrom(AStream, 0); + Stream.LoadFromStream(AStream); Changed; end; @@ -5825,7 +5824,7 @@ procedure TInstantBlob.SaveDataToStream(AStream: TStream); begin if Assigned(AStream) then - AStream.CopyFrom(Stream, 0); + Stream.SaveToStream(AStream); end; procedure TInstantBlob.SetAsString(const AValue: string); Modified: trunk/Source/Core/InstantPresentation.pas =================================================================== --- trunk/Source/Core/InstantPresentation.pas 2006-02-23 18:33:19 UTC (rev 625) +++ trunk/Source/Core/InstantPresentation.pas 2006-02-25 00:10:30 UTC (rev 626) @@ -2145,6 +2145,8 @@ case AttributeMetadata.AttributeType of atBlob: Result := ftBlob; + atGraphic: + Result := ftGraphic; atMemo: Result := ftMemo; else |