View Issue Details

IDProjectCategoryView StatusLast Update
0022854PackagesTAChartpublic2012-09-11 16:21
Reportermbuckingham Assigned ToAlexander S. Klenin  
Status resolvedResolutionfixed 
Product Version1.0.0 
Summary0022854: function TBasicPointSeries.GetNearestPoint can fail
DescriptionThe function TBasicPointSeries.GetNearestPoint returns a boolean and the assumption my code makes is that TRUE means everything worked OK. However the function only checks if the number of points in the series is greater than zero.

It is possible for none of the points in the series to be with the radius specified but the function will still return TRUE and this then leads to an 'EListError'. The only way I have of checking for this is by testing if AResults.FDist is equal to MaxInt, but this requires knowledge of the internal working s of GetNearestPoint.
Additional InformationOne possible fix is to set Result to FALSE at the start of the function. Then set Result to TRUE as the last line of the "for i := 0 to Count - 1" loop. The function will then only return TRUE once it has successfully found a point within the given radius.
TagsNo tags attached.
Fixed in Revision38617
Attached Files


has duplicate 0022855 resolvedAlexander S. Klenin function TBasicPointSeries.GetNearestPoint can fail 


Alexander S. Klenin

2012-09-11 16:20

developer   ~0062294

You are correct.
Additionally, FIndex now always contains -1 when no point is found,
while before it could contain garbage.
Please test.

Issue History

Date Modified Username Field Change
2012-09-11 12:35 mbuckingham New Issue
2012-09-11 12:35 mbuckingham Status new => assigned
2012-09-11 12:35 mbuckingham Assigned To => Alexander S. Klenin
2012-09-11 12:35 mbuckingham Widgetset => Win32/Win64
2012-09-11 15:04 Alexander S. Klenin Relationship added has duplicate 0022855
2012-09-11 16:20 Alexander S. Klenin Fixed in Revision => 38617
2012-09-11 16:20 Alexander S. Klenin LazTarget => -
2012-09-11 16:20 Alexander S. Klenin Status assigned => resolved
2012-09-11 16:20 Alexander S. Klenin Resolution open => fixed
2012-09-11 16:20 Alexander S. Klenin Note Added: 0062294