buggy TCustomDBChart.CheckNewDataSource
Posted: Fri Jun 11, 2004 6:46 am
Hi,
The method is faulty because it increases the IDataSources.Count every time it is called. The item added to the list is of type TDBChartDataSource and created local, and so, searching the input parameter ADataSet will always fail, thus the method will add another item to the list.
I added the following code at the beginning of the method and my problem is gone, can you guys check and more important fix this in v7, in case it was not yet fixed
for I := 0 to IDataSources.Count - 1 do
if TDBChartDataSource(IDataSources).Dataset = ADataset then
Exit;
regards,
Lucian
The method is faulty because it increases the IDataSources.Count every time it is called. The item added to the list is of type TDBChartDataSource and created local, and so, searching the input parameter ADataSet will always fail, thus the method will add another item to the list.
I added the following code at the beginning of the method and my problem is gone, can you guys check and more important fix this in v7, in case it was not yet fixed
for I := 0 to IDataSources.Count - 1 do
if TDBChartDataSource(IDataSources).Dataset = ADataset then
Exit;
regards,
Lucian