In Laz1.8RC2, TAChart will crash with a range-check error when a chart is clicked onto the form. Unfortunately a patch had not been backported from trunk to RC2.
Here are instructions how to fix this severe issue in your RC2 manually:
- Open file propedits.pp. It is in folder components/ideintf of your Lazarus installation
- Seek the implementation of the method TPropertyEditor.CallStoredFunction, it should begin near line 2560.
- Replace this function, along with the preceding declaration of TBoolFunc, with the following code. Then rebuild the IDE (Menu "Tools" > "Build Lazarus with profile..."
type
TBoolFunc = function: Boolean of object;
TBoolIndexFunc = function(const Index: Integer): Boolean of object;
function TPropertyEditor.CallStoredFunction: Boolean;
var
Met: TMethod;
Func: TBoolFunc;
IndexFunc: TBoolIndexFunc;
APropInfo: PPropInfo;
StoredProcType: Byte;
begin
APropInfo:=FPropList^[0].PropInfo;
StoredProcType := ((APropInfo^.PropProcs shr 4) and 3);
if StoredProcType in [ptStatic, ptVirtual] then
begin
case StoredProcType of
ptStatic: Met.Code := APropInfo^.StoredProc;
ptVirtual: Met.Code := PPointer(Pointer(FPropList^[0].Instance.ClassType))[{%H-}PtrInt(APropInfo^.StoredProc) div SizeOf(Pointer)];
end;
if Met.Code = nil then
raise EPropertyError.Create('No property stored method available');
Met.Data := FPropList^[0].Instance;
if ((APropInfo^.PropProcs shr 6) and 1) <> 0 then // has index property
begin
IndexFunc := TBoolIndexFunc(Met);
Result := IndexFunc(APropInfo^.Index);
end else
begin
Func := TBoolFunc(Met);
Result := Func();
end;
end else
if StoredProcType = ptConst then
Result := APropInfo^.StoredProc<>nil
else
raise EPropertyError.Create('No property stored method/const available');
end;