mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-08 10:59:44 +01:00
tachart: fix range check errors
git-svn-id: trunk@24811 -
This commit is contained in:
parent
1088982d5b
commit
5451a2e4a3
@ -323,6 +323,9 @@ implementation
|
|||||||
uses
|
uses
|
||||||
Clipbrd, GraphMath, LCLProc, Math, Types;
|
Clipbrd, GraphMath, LCLProc, Math, Types;
|
||||||
|
|
||||||
|
{$IFOPT R+}{$DEFINE RangeChecking}{$ELSE}{$UNDEF RangeChecking}{$ENDIF}
|
||||||
|
{$IFOPT Q+}{$DEFINE OverflowChecking}{$ELSE}{$UNDEF OverflowChecking}{$ENDIF}
|
||||||
|
|
||||||
function CompareZPosition(AItem1, AItem2: Pointer): Integer;
|
function CompareZPosition(AItem1, AItem2: Pointer): Integer;
|
||||||
begin
|
begin
|
||||||
Result :=
|
Result :=
|
||||||
@ -1011,6 +1014,7 @@ procedure TChart.UpdateExtent;
|
|||||||
begin
|
begin
|
||||||
if AUseMin then ALo := AMin;
|
if AUseMin then ALo := AMin;
|
||||||
if AUseMax then AHi := AMax;
|
if AUseMax then AHi := AMax;
|
||||||
|
{$R-}{$Q-}
|
||||||
case CASE_OF_TWO[ALo = Infinity, AHi = NegInfinity] of
|
case CASE_OF_TWO[ALo = Infinity, AHi = NegInfinity] of
|
||||||
cotNone: begin // Both high and low boundary defined
|
cotNone: begin // Both high and low boundary defined
|
||||||
if ALo = AHi then begin
|
if ALo = AHi then begin
|
||||||
@ -1030,6 +1034,7 @@ procedure TChart.UpdateExtent;
|
|||||||
AHi := DEFAULT_WIDTH / 2;
|
AHi := DEFAULT_WIDTH / 2;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$ifdef OverflowChecking}{$Q+}{$endif}{$ifdef RangeChecking}{$R+}{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
|
|||||||
@ -205,6 +205,9 @@ implementation
|
|||||||
uses
|
uses
|
||||||
LCLIntf, Math, StrUtils;
|
LCLIntf, Math, StrUtils;
|
||||||
|
|
||||||
|
{$IFOPT R+}{$DEFINE RangeChecking}{$ELSE}{$UNDEF RangeChecking}{$ENDIF}
|
||||||
|
{$IFOPT Q+}{$DEFINE OverflowChecking}{$ELSE}{$UNDEF OverflowChecking}{$ENDIF}
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{ TListChartSourceStrings }
|
{ TListChartSourceStrings }
|
||||||
@ -573,7 +576,9 @@ begin
|
|||||||
FExtent.b.X := Max(FExtent.b.X, Item[i]^.X);
|
FExtent.b.X := Max(FExtent.b.X, Item[i]^.X);
|
||||||
end;
|
end;
|
||||||
if oldX = FExtent.a.X then begin
|
if oldX = FExtent.a.X then begin
|
||||||
|
{$R-}{$Q-}
|
||||||
FExtent.a.X := Infinity;
|
FExtent.a.X := Infinity;
|
||||||
|
{$ifdef OverflowChecking}{$Q+}{$endif}{$ifdef RangeChecking}{$R+}{$endif}
|
||||||
for i := 0 to Count - 1 do
|
for i := 0 to Count - 1 do
|
||||||
FExtent.a.X := Min(FExtent.a.X, Item[i]^.X);
|
FExtent.a.X := Min(FExtent.a.X, Item[i]^.X);
|
||||||
end;
|
end;
|
||||||
@ -602,7 +607,9 @@ begin
|
|||||||
FExtent.b.Y := Max(FExtent.b.Y, Item[i]^.Y);
|
FExtent.b.Y := Max(FExtent.b.Y, Item[i]^.Y);
|
||||||
end;
|
end;
|
||||||
if oldY = FExtent.a.Y then begin
|
if oldY = FExtent.a.Y then begin
|
||||||
|
{$R-}{$Q-}
|
||||||
FExtent.a.Y := Infinity;
|
FExtent.a.Y := Infinity;
|
||||||
|
{$ifdef OverflowChecking}{$Q+}{$endif}{$ifdef RangeChecking}{$R+}{$endif}
|
||||||
for i := 0 to Count - 1 do
|
for i := 0 to Count - 1 do
|
||||||
FExtent.a.Y := Min(FExtent.a.Y, Item[i]^.Y);
|
FExtent.a.Y := Min(FExtent.a.Y, Item[i]^.Y);
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -171,6 +171,9 @@ uses
|
|||||||
ComponentEditors, Forms, GraphMath, Math, PropEdits, SysUtils, Types,
|
ComponentEditors, Forms, GraphMath, Math, PropEdits, SysUtils, Types,
|
||||||
TAChartUtils, TASubcomponentsEditor;
|
TAChartUtils, TASubcomponentsEditor;
|
||||||
|
|
||||||
|
{$IFOPT R+}{$DEFINE RangeChecking}{$ELSE}{$UNDEF RangeChecking}{$ENDIF}
|
||||||
|
{$IFOPT Q+}{$DEFINE OverflowChecking}{$ELSE}{$UNDEF OverflowChecking}{$ENDIF}
|
||||||
|
|
||||||
type
|
type
|
||||||
{ TToolsComponentEditor }
|
{ TToolsComponentEditor }
|
||||||
|
|
||||||
@ -586,6 +589,7 @@ var
|
|||||||
df: TPointDistFunc;
|
df: TPointDistFunc;
|
||||||
begin
|
begin
|
||||||
if FChart.ReticuleMode = rmNone then exit;
|
if FChart.ReticuleMode = rmNone then exit;
|
||||||
|
{$R-}{$Q-}
|
||||||
minDist := Infinity;
|
minDist := Infinity;
|
||||||
df := DIST_FUNCS[FChart.ReticuleMode];
|
df := DIST_FUNCS[FChart.ReticuleMode];
|
||||||
for i := 0 to FChart.SeriesCount - 1 do
|
for i := 0 to FChart.SeriesCount - 1 do
|
||||||
@ -605,6 +609,7 @@ begin
|
|||||||
if Assigned(FChart.OnDrawReticule) then
|
if Assigned(FChart.OnDrawReticule) then
|
||||||
FChart.OnDrawReticule(FChart, bestSeries, pointIndex, value);
|
FChart.OnDrawReticule(FChart, bestSeries, pointIndex, value);
|
||||||
end;
|
end;
|
||||||
|
{$ifdef OverflowChecking}{$Q+}{$endif}{$ifdef RangeChecking}{$R+}{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TZoomClickTool }
|
{ TZoomClickTool }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user