diff --git a/components/ideintf/propedits.pp b/components/ideintf/propedits.pp index da0a3d30e1..aea4e79447 100644 --- a/components/ideintf/propedits.pp +++ b/components/ideintf/propedits.pp @@ -2554,10 +2554,12 @@ end; type TBoolFunc = function: Boolean of object; + TBoolIndexFunc = function(const Index: Integer): Boolean of object; function TPropertyEditor.CallStoredFunction: Boolean; var - Func: TMethod; - FFunc: TBoolFunc; + Met: TMethod; + Func: TBoolFunc; + IndexFunc: TBoolIndexFunc; APropInfo: PPropInfo; StoredProcType: Byte; begin @@ -2566,14 +2568,21 @@ begin if StoredProcType in [ptStatic, ptVirtual] then begin case StoredProcType of - ptStatic: Func.Code := APropInfo^.StoredProc; - ptVirtual: Func.Code := PPointer(Pointer(FPropList^[0].Instance.ClassType))[{%H-}PtrInt(APropInfo^.StoredProc) div SizeOf(Pointer)]; + ptStatic: Met.Code := APropInfo^.StoredProc; + ptVirtual: Met.Code := PPointer(Pointer(FPropList^[0].Instance.ClassType))[{%H-}PtrInt(APropInfo^.StoredProc) div SizeOf(Pointer)]; end; - if Func.Code = nil then + if Met.Code = nil then raise EPropertyError.Create('No property stored method available'); - Func.Data := FPropList^[0].Instance; - FFunc := TBoolFunc(Func); - Result := FFunc(); + 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