From: <jfu...@us...> - 2011-04-01 19:04:16
|
Revision: 13010 http://jvcl.svn.sourceforge.net/jvcl/?rev=13010&view=rev Author: jfudickar Date: 2011-04-01 19:04:09 +0000 (Fri, 01 Apr 2011) Log Message: ----------- Mantis 0005534: [TJvCustomCsvDataSet]: create calculated /lookup fields at run-time Modified Paths: -------------- trunk/jvcl/run/JvCsvData.pas Modified: trunk/jvcl/run/JvCsvData.pas =================================================================== --- trunk/jvcl/run/JvCsvData.pas 2011-03-31 19:51:25 UTC (rev 13009) +++ trunk/jvcl/run/JvCsvData.pas 2011-04-01 19:04:09 UTC (rev 13010) @@ -728,6 +728,7 @@ function GetColumnsAsString: string; virtual; { Row Append one string } procedure AppendRowString(const RowAsString: string); // Along with GetRowAsString, easy way to copy a dataset to another dataset! + procedure CreateFields; override; function IsKeyUnique: Boolean; // Checks current row's key uniqueness. Note that FCsvKeyDef MUST be set! procedure SaveToFile(const FileName: string); @@ -3712,11 +3713,12 @@ else FOpenFileName := ''; - InternalInitFieldDefs; // initialize FieldDef objects. - // Create TField components when no persistent fields have been created if DefaultFields then - CreateFields; + CreateFields // InternalInitFieldDefs is called inside + else + InternalInitFieldDefs; // initialize FieldDef objects. + BindFields(True); // bind FieldDefs to actual Data if FCsvColumns.Count > 1 then @@ -5607,6 +5609,12 @@ end; end; +procedure TJvCustomCsvDataSet.CreateFields; +begin + InternalInitFieldDefs; + inherited CreateFields; +end; + //------------------------------------------------------------------------- //DeleteCsvColumn // This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |