On Sun, 14 Dec 2003, Darek Mazur wrote:
Hi
I investigated read property from Lazarus LRS, and I noticed that tColor
property with Identifies don't work and crash program (for example
tForm.COLOR:=clWindow)
I write small patch to avoid this
this is new function in CLASSES.INC
// start patch
function GlobalIdentToInt(const Ident: String; var Int: LongInt):boolean;
var
i : Integer;
begin
with IntConstList.LockList do
try
for i := 0 to Count - 1 do
if TIntConst(Items[I]).IdentToIntFn(Ident, Int) then exit(True);
Result := false;
finally
IntConstList.UnlockList;
end;
end;
// *stop patch
and changes in READER.INC
in procedure TReader.ReadPropValue(Instance: TPersistent; PropInfo:
Pointer);
from:
case PropType^.Kind of
tkInteger:
if FDriver.NextValue = vaIdent then
begin
Ident := ReadIdent;
// *start patch
if GlobalIdentToInt(Ident,Value) then
SetOrdProp(Instance, PropInfo, Value)
else
raise EReadError.Create(SInvalidPropertyValue);
// *stop patch
end else
SetOrdProp(Instance, PropInfo, ReadInteger);
tkBool:
SetOrdProp(Instance, PropInfo, Ord(ReadBoolean));
with this patch Delphi DFM converted to Lazarus LRS works fine
Committed the patch, thank you.
Michael.
___
fpc-devel maillist - [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel