[fpc-devel] Recent changes to TField.SetData

Michael Van Canneyt michael at freepascal.org
Mon Apr 4 08:29:42 CEST 2011



On Mon, 4 Apr 2011, LacaK wrote:

> Hi,
> This fix 
> http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/packages/fcl-db/src/base/fields.inc?r1=17199&r2=17220
> fixes mising call to TField.Validate (before data are written into record 
> buffer) and adds also call to TField.DataChanged (after data are written)
>
> But It seems to me, that DataChanged is now called 2 times
>
> First in TDataSet descendants in SetFieldData method (see bufdataset.pas, 
> dbf.pas, paradox.pp, meds.pp) and second in above mentioned place.
>
> So it would be good remove this call from TDataSet descendants. For example 
> for bufdataset.pas:
>
> 1860   if not (State in [dsCalcFields, dsFilter, dsNewValue]) then
> 1861     DataEvent(deFieldChange, Ptrint(Field));

Hm. 
No, we'll remove the call from TField.

There may be other descendants (AnyDac, Zeos and whatnot) that also call DataEvent
and OnValidate, and we cannot apply this change on them.

Michael.



More information about the fpc-devel mailing list