RE: [fpc-devel]patch for ReadPropValue

2003-12-29 Thread Michael . VanCanneyt


On Mon, 29 Dec 2003, Vincent Snijders wrote:

  Van: Michael Van Canneyt [mailto:[EMAIL PROTECTED] 
  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
 
 snipped patch 
 
  
   with this patch Delphi DFM converted to Lazarus LRS works fine
  
  Committed the patch, thank you.
  
  Michael.
 Could you apply this patch to the fixes branch too?

There is no fixes branch for the FCL. It is shared between 1.0.X and 1.9.X
I've given more details to Micha Nelissen in a private mail.

Michael.

___
fpc-devel maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel]patch for ReadPropValue

2003-12-15 Thread Michael Van Canneyt


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