From df925c15ce0812df7202e06553031838aedc75de Mon Sep 17 00:00:00 2001 From: wp Date: Mon, 18 Feb 2019 18:30:05 +0000 Subject: [PATCH] TAChart: Revert r60446 #0ec4d4477b (breaks third-party chart sources). git-svn-id: trunk@60451 - --- components/tachart/taanimatedsource.pas | 8 +++--- components/tachart/taaxissource.pas | 8 +++--- components/tachart/tacustomseries.pas | 8 +++--- components/tachart/tacustomsource.pas | 12 ++++---- components/tachart/tadbsource.pas | 4 +-- components/tachart/taintervalsources.pas | 8 +++--- components/tachart/tamultiseries.pas | 26 ++++++++--------- components/tachart/tasources.pas | 36 ++++++++++++------------ 8 files changed, 55 insertions(+), 55 deletions(-) diff --git a/components/tachart/taanimatedsource.pas b/components/tachart/taanimatedsource.pas index 2cb1ee983b..8a040f9ba5 100644 --- a/components/tachart/taanimatedsource.pas +++ b/components/tachart/taanimatedsource.pas @@ -48,8 +48,8 @@ type protected function GetCount: Integer; override; function GetItem(AIndex: Integer): PChartDataItem; override; - procedure SetXCount(AValue: Integer); override; - procedure SetYCount(AValue: Integer); override; + procedure SetXCount(AValue: Cardinal); override; + procedure SetYCount(AValue: Cardinal); override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -189,13 +189,13 @@ begin FOrigin.Broadcaster.Subscribe(FListener); end; -procedure TCustomAnimatedChartSource.SetXCount(AValue: Integer); +procedure TCustomAnimatedChartSource.SetXCount(AValue: Cardinal); begin Unused(AValue); raise EXCountError.Create('Cannot set XCount'); end; -procedure TCustomAnimatedChartSource.SetYCount(AValue: Integer); +procedure TCustomAnimatedChartSource.SetYCount(AValue: Cardinal); begin Unused(AValue); raise EYCountError.Create('Cannot set YCount'); diff --git a/components/tachart/taaxissource.pas b/components/tachart/taaxissource.pas index 2f8d75d849..ab50fe31d9 100644 --- a/components/tachart/taaxissource.pas +++ b/components/tachart/taaxissource.pas @@ -27,8 +27,8 @@ type protected function GetCount: Integer; override; function GetItem(AIndex: Integer): PChartDataItem; override; - procedure SetXCount(AValue: Integer); override; - procedure SetYCount(AValue: Integer); override; + procedure SetXCount(AValue: Cardinal); override; + procedure SetYCount(AValue: Cardinal); override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -89,13 +89,13 @@ begin Result := true; end; -procedure TCustomAxisChartSource.SetXCount(AValue: Integer); +procedure TCustomAxisChartSource.SetXCount(AValue: Cardinal); begin Unused(AValue); raise EXCountError.Create('Cannot set XCount'); end; -procedure TCustomAxisChartSource.SetYCount(AValue: Integer); +procedure TCustomAxisChartSource.SetYCount(AValue: Cardinal); begin Unused(AValue); raise EYCountError.Create('Cannot set YCount'); diff --git a/components/tachart/tacustomseries.pas b/components/tachart/tacustomseries.pas index 1243c92514..5112e3a5e9 100644 --- a/components/tachart/tacustomseries.pas +++ b/components/tachart/tacustomseries.pas @@ -165,7 +165,7 @@ type procedure SourceChanged(ASender: TObject); virtual; procedure VisitSources( AVisitor: TChartOnSourceVisitor; AAxis: TChartAxis; var AData); override; - class procedure GetXYCountNeeded(out AXCount, AYCount: Integer); virtual; + class procedure GetXYCountNeeded(out AXCount, AYCount: Cardinal); virtual; strict protected function LegendTextPoint(AIndex: Integer): String; inline; protected @@ -787,7 +787,7 @@ end; procedure TChartSeries.CheckSource(ASource: TCustomChartSource); var - nx, ny: Integer; + nx, ny: Cardinal; begin if ASource = nil then exit; @@ -817,7 +817,7 @@ constructor TChartSeries.Create(AOwner: TComponent); const BUILTIN_SOURCE_NAME = 'Builtin'; var - nx, ny: Integer; + nx, ny: Cardinal; begin inherited Create(AOwner); @@ -967,7 +967,7 @@ begin Result := 0; end; -class procedure TChartSeries.GetXYCountNeeded(out AXCount, AYCount: Integer); +class procedure TChartSeries.GetXYCountNeeded(out AXCount, AYCount: Cardinal); begin AXCount := 1; AYCount := 1; diff --git a/components/tachart/tacustomsource.pas b/components/tachart/tacustomsource.pas index b95edd9ee4..2d35b39611 100644 --- a/components/tachart/tacustomsource.pas +++ b/components/tachart/tacustomsource.pas @@ -190,8 +190,8 @@ type FExtentIsValid: Boolean; FValuesTotal: Double; FValuesTotalIsValid: Boolean; - FXCount: Integer; - FYCount: Integer; + FXCount: Cardinal; + FYCount: Cardinal; procedure ChangeErrorBars(Sender: TObject); virtual; function GetCount: Integer; virtual; abstract; function GetErrorBarValues(APointIndex: Integer; Which: Integer; @@ -199,8 +199,8 @@ type function GetHasErrorBars(Which: Integer): Boolean; function GetItem(AIndex: Integer): PChartDataItem; virtual; abstract; procedure InvalidateCaches; - procedure SetXCount(AValue: Integer); virtual; abstract; - procedure SetYCount(AValue: Integer); virtual; abstract; + procedure SetXCount(AValue: Cardinal); virtual; abstract; + procedure SetYCount(AValue: Cardinal); virtual; abstract; property XErrorBarData: TChartErrorBarData index 0 read GetErrorBarData write SetErrorBarData stored IsErrorBarDataStored; property YErrorBarData: TChartErrorBarData index 1 read GetErrorBarData @@ -245,8 +245,8 @@ type property Count: Integer read GetCount; property Item[AIndex: Integer]: PChartDataItem read GetItem; default; - property XCount: Integer read FXCount write SetXCount default 1; - property YCount: Integer read FYCount write SetYCount default 1; + property XCount: Cardinal read FXCount write SetXCount default 1; + property YCount: Cardinal read FYCount write SetYCount default 1; end; { TChartSourceBuffer } diff --git a/components/tachart/tadbsource.pas b/components/tachart/tadbsource.pas index 0a02ef987d..3cf80407b1 100644 --- a/components/tachart/tadbsource.pas +++ b/components/tachart/tadbsource.pas @@ -52,7 +52,7 @@ type protected function GetCount: Integer; override; function GetItem(AIndex: Integer): PChartDataItem; override; - procedure SetYCount(AValue: Integer); override; + procedure SetYCount(AValue: Cardinal); override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -322,7 +322,7 @@ begin Reset; end; -procedure TDbChartSource.SetYCount(AValue: Integer); +procedure TDbChartSource.SetYCount(AValue: Cardinal); begin Unused(AValue); raise EYCountError.Create('Set FieldY instead'); diff --git a/components/tachart/taintervalsources.pas b/components/tachart/taintervalsources.pas index 7dea25ba7c..19c6896212 100644 --- a/components/tachart/taintervalsources.pas +++ b/components/tachart/taintervalsources.pas @@ -32,8 +32,8 @@ type protected function GetCount: Integer; override; function GetItem(AIndex: Integer): PChartDataItem; override; - procedure SetXCount(AValue: Integer); override; - procedure SetYCount(AValue: Integer); override; + procedure SetXCount(AValue: Cardinal); override; + procedure SetYCount(AValue: Cardinal); override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -363,13 +363,13 @@ begin Notify; end; -procedure TIntervalChartSource.SetXCount(AValue: Integer); +procedure TIntervalChartSource.SetXCount(AValue: Cardinal); begin Unused(AValue); raise EXCountError.Create('Cannot set XCount'); end; -procedure TIntervalChartSource.SetYCount(AValue: Integer); +procedure TIntervalChartSource.SetYCount(AValue: Cardinal); begin Unused(AValue); raise EYCountError.Create('Cannot set YCount'); diff --git a/components/tachart/tamultiseries.pas b/components/tachart/tamultiseries.pas index f6a5477948..38f92ae033 100644 --- a/components/tachart/tamultiseries.pas +++ b/components/tachart/tamultiseries.pas @@ -55,7 +55,7 @@ type function GetLabelDataPoint(AIndex, AYIndex: Integer): TDoublePoint; override; procedure GetLegendItems(AItems: TChartLegendItems); override; function GetSeriesColor: TColor; override; - class procedure GetXYCountNeeded(out AXCount, AYCount: Integer); override; + class procedure GetXYCountNeeded(out AXCount, AYCount: Cardinal); override; function ToolTargetDistance(const AParams: TNearestPointParams; AGraphPt: TDoublePoint; APointIdx, AXIdx, AYIdx: Integer): Integer; override; procedure UpdateLabelDirectionReferenceLevel(AIndex, AYIndex: Integer; @@ -111,7 +111,7 @@ type protected procedure GetLegendItems(AItems: TChartLegendItems); override; function GetSeriesColor: TColor; override; - class procedure GetXYCountNeeded(out AXCount, AYCount: Integer); override; + class procedure GetXYCountNeeded(out AXCount, AYCount: Cardinal); override; function SkipMissingValues(AIndex: Integer): Boolean; override; function ToolTargetDistance(const AParams: TNearestPointParams; AGraphPt: TDoublePoint; APointIdx, AXIdx, AYIdx: Integer): Integer; override; @@ -184,7 +184,7 @@ type protected procedure GetLegendItems(AItems: TChartLegendItems); override; function GetSeriesColor: TColor; override; - class procedure GetXYCountNeeded(out AXCount, AYCount: Integer); override; + class procedure GetXYCountNeeded(out AXCount, AYCount: Cardinal); override; function SkipMissingValues(AIndex: Integer): Boolean; override; function ToolTargetDistance(const AParams: TNearestPointParams; AGraphPt: TDoublePoint; APointIdx, AXIdx, AYIdx: Integer): Integer; override; @@ -243,7 +243,7 @@ type function GetColor(AIndex: Integer): TColor; inline; function GetVectorPoints(AIndex: Integer; out AStartPt, AEndPt: TDoublePoint): Boolean; inline; - class procedure GetXYCountNeeded(out AXCount, AYCount: Integer); override; + class procedure GetXYCountNeeded(out AXCount, AYCount: Cardinal); override; public procedure Assign(ASource: TPersistent); override; constructor Create(AOwner: TComponent); override; @@ -515,7 +515,7 @@ var irect: TRect; dummyR: TRect = (Left:0; Top:0; Right:0; Bottom:0); ext: TDoubleRect; - nx, ny: Integer; + nx, ny: Cardinal; begin GetXYCountNeeded(nx, ny); if Source.YCount < ny then exit; @@ -721,7 +721,7 @@ begin Result := FBubbleBrush.Color; end; -class procedure TBubbleSeries.GetXYCountNeeded(out AXCount, AYCount: Integer); +class procedure TBubbleSeries.GetXYCountNeeded(out AXCount, AYCount: Cardinal); begin AXCount := 1; AYCount := 2; @@ -982,7 +982,7 @@ var ext2: TDoubleRect; x, ymin, yqmin, ymed, yqmax, ymax, wb, ww, w: Double; i: Integer; - nx, ny: Integer; + nx, ny: Cardinal; begin GetXYCountNeeded(nx, ny); if IsEmpty or (Source.YCount < ny) then @@ -1152,7 +1152,7 @@ begin Result := BoxBrush.Color; end; -class procedure TBoxAndWhiskerSeries.GetXYCountNeeded(out AXCount, AYCount: Integer); +class procedure TBoxAndWhiskerSeries.GetXYCountNeeded(out AXCount, AYCount: Cardinal); begin AXCount := 1; AYCount := 5; @@ -1428,12 +1428,12 @@ procedure TOpenHighLowCloseSeries.Draw(ADrawer: IChartDrawer); end; var - my: Integer; + my: Cardinal; ext2: TDoubleRect; i: Integer; x, tw, yopen, yhigh, ylow, yclose: Double; p: TPen; - nx, ny: Integer; + nx, ny: Cardinal; begin GetXYCountNeeded(nx, ny); if (Source.XCount < nx) or (Source.YCount < ny) then exit; @@ -1596,7 +1596,7 @@ begin Result := LinePen.Color; end; -class procedure TOpenHighLowCloseSeries.GetXYCountNeeded(out AXCount, AYCount: Integer); +class procedure TOpenHighLowCloseSeries.GetXYCountNeeded(out AXCount, AYCount: Cardinal); begin AXCount := 1; AYCount := 4; @@ -1814,7 +1814,7 @@ var i: Integer; p1, p2: TDoublePoint; lPen: TPen; - nx, ny: Integer; + nx, ny: Cardinal; begin GetXYCountNeeded(nx, ny); if (Source.XCount < nx) or (Source.YCount < ny) then exit; @@ -2001,7 +2001,7 @@ begin end; end; -class procedure TFieldSeries.GetXYCountNeeded(out AXCount, AYCount: Integer); +class procedure TFieldSeries.GetXYCountNeeded(out AXCount, AYCount: Cardinal); begin AXCount := 2; AYCount := 2; diff --git a/components/tachart/tasources.pas b/components/tachart/tasources.pas index 2905656124..dfd0be99a4 100644 --- a/components/tachart/tasources.pas +++ b/components/tachart/tasources.pas @@ -37,8 +37,8 @@ type protected function GetCount: Integer; override; function GetItem(AIndex: Integer): PChartDataItem; override; - procedure SetXCount(AValue: Integer); override; - procedure SetYCount(AValue: Integer); override; + procedure SetXCount(AValue: Cardinal); override; + procedure SetYCount(AValue: Cardinal); override; public type EXListEmptyError = class(EChartError); @@ -123,8 +123,8 @@ type procedure ChangeErrorBars(Sender: TObject); override; function GetCount: Integer; override; function GetItem(AIndex: Integer): PChartDataItem; override; - procedure SetXCount(AValue: Integer); override; - procedure SetYCount(AValue: Integer); override; + procedure SetXCount(AValue: Cardinal); override; + procedure SetYCount(AValue: Cardinal); override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -165,8 +165,8 @@ type protected function GetCount: Integer; override; function GetItem(AIndex: Integer): PChartDataItem; override; - procedure SetXCount(AValue: Integer); override; - procedure SetYCount(AValue: Integer); override; + procedure SetXCount(AValue: Cardinal); override; + procedure SetYCount(AValue: Cardinal); override; public procedure EndUpdate; override; function IsSorted: Boolean; override; @@ -197,7 +197,7 @@ type FItem: TChartDataItem; FListener: TListener; FOrigin: TCustomChartSource; - FOriginYCount: Integer; + FOriginYCount: Cardinal; FPercentage: Boolean; FReorderYList: String; FYOrder: array of Integer; @@ -220,8 +220,8 @@ type protected function GetCount: Integer; override; function GetItem(AIndex: Integer): PChartDataItem; override; - procedure SetXCount(AValue: Integer); override; - procedure SetYCount(AValue: Integer); override; + procedure SetXCount(AValue: Cardinal); override; + procedure SetYCount(AValue: Cardinal); override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -350,7 +350,7 @@ var begin parts := Split(AString); try - if (FSource.XCount = 1) and (FSource.YCount + 3 < parts.Count) then + if (FSource.XCount = 1) and (FSource.YCount + 3 < Cardinal(parts.Count)) then FSource.YCount := parts.Count - 3; with ADataItem^ do begin X := StrToFloatOrDateTimeDef(NextPart); @@ -575,7 +575,7 @@ begin Notify; end; -procedure TListChartSource.SetXCount(AValue: Integer); +procedure TListChartSource.SetXCount(AValue: Cardinal); var i: Integer; begin @@ -649,7 +649,7 @@ begin Notify; end; -procedure TListChartSource.SetYCount(AValue: Integer); +procedure TListChartSource.SetYCount(AValue: Cardinal); var i: Integer; begin @@ -935,7 +935,7 @@ begin Reset; end; -procedure TRandomChartSource.SetXCount(AValue: Integer); +procedure TRandomChartSource.SetXCount(AValue: Cardinal); begin if XCount = AValue then exit; FXCount := AValue; @@ -956,7 +956,7 @@ begin Reset; end; -procedure TRandomChartSource.SetYCount(AValue: Integer); +procedure TRandomChartSource.SetYCount(AValue: Cardinal); begin if YCount = AValue then exit; FYCount := AValue; @@ -1034,7 +1034,7 @@ begin Reset; end; -procedure TUserDefinedChartSource.SetXCount(AValue: Integer); +procedure TUserDefinedChartSource.SetXCount(AValue: Cardinal); begin if FXCount = AValue then exit; FXCount := AValue; @@ -1042,7 +1042,7 @@ begin Reset; end; -procedure TUserDefinedChartSource.SetYCount(AValue: Integer); +procedure TUserDefinedChartSource.SetYCount(AValue: Cardinal); begin if FYCount = AValue then exit; FYCount := AValue; @@ -1372,13 +1372,13 @@ begin UpdateYOrder; end; -procedure TCalculatedChartSource.SetXCount(AValue: Integer); +procedure TCalculatedChartSource.SetXCount(AValue: Cardinal); begin Unused(AValue); raise EXCountError.Create('Cannot set XCount'); end; -procedure TCalculatedChartSource.SetYCount(AValue: Integer); +procedure TCalculatedChartSource.SetYCount(AValue: Cardinal); begin Unused(AValue); raise EYCountError.Create('Cannot set YCount');