Second attempt to fix bug #868: during login heidi crashes

This commit is contained in:
Ansgar Becker
2008-11-11 21:02:28 +00:00
parent 19e7043a0a
commit 625d2ca3fb

View File

@@ -2333,13 +2333,9 @@ begin
avg_perhour := '';
avg_persec := '';
// Format numeric or byte values
// Detect value type
valIsNumber := IntToStr(MakeInt(val)) = val;
valIsBytes := valIsNumber and (Copy(ds.Fields[0].AsWideString, 1, 6) = 'Bytes_');
if valIsBytes then
val := FormatByteNumber(val)
else if valIsNumber then
val := FormatNumber(val);
// Calculate average values ...
if valIsNumber then begin
@@ -2354,6 +2350,12 @@ begin
else avg_persec := FormatNumber( tmpval, 1 );
end;
// Format numeric or byte values
if valIsBytes then
val := FormatByteNumber(val)
else if valIsNumber then
val := FormatNumber(val);
VTRowDataListStatus[i-1].Captions.Add( val );
VTRowDataListStatus[i-1].Captions.Add(avg_perhour);
VTRowDataListStatus[i-1].Captions.Add(avg_persec);