From 85a6d9eae36e768dfcb8b239b45e85b036bcd9c9 Mon Sep 17 00:00:00 2001 From: ask Date: Mon, 2 Nov 2009 01:11:56 +0000 Subject: [PATCH] TAChart: Use overloaded operator= instead of LCLProc.CompareMethods git-svn-id: trunk@22376 - --- components/tachart/tachartutils.pas | 10 ++++++++-- components/tachart/taseries.pas | 6 +++--- components/tachart/tasources.pas | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/components/tachart/tachartutils.pas b/components/tachart/tachartutils.pas index e18033ef07..cfe9834ac5 100644 --- a/components/tachart/tachartutils.pas +++ b/components/tachart/tachartutils.pas @@ -189,11 +189,12 @@ procedure Unused(const A1, A2); procedure UpdateMinMax(AValue: Double; var AMin, AMax: Double); operator +(const A: TPoint; B: TSize): TPoint; +operator =(const A, B: TMethod): Boolean; implementation uses - LCLIntf, LCLProc; + LCLIntf; procedure CalculateIntervals( AMin, AMax: Double; AxisScale: TAxisScale; out AStart, AStep: Double); @@ -486,6 +487,11 @@ begin Result.Y := A.Y + B.cy; end; +operator = (const A, B: TMethod): Boolean; +begin + Result := (A.Code = B.Code) and (A.Data = B.Data); +end; + { TPenBrushFontRecall } constructor TPenBrushFontRecall.Create(ACanvas: TCanvas; AParams: TPenBrushFont); @@ -635,7 +641,7 @@ end; procedure TIntervalList.SetOnChange(AValue: TNotifyEvent); begin - if CompareMethods(TMethod(FOnChange), TMethod(AValue)) then exit; + if TMethod(FOnChange) = TMethod(AValue) then exit; FOnChange := AValue; end; diff --git a/components/tachart/taseries.pas b/components/tachart/taseries.pas index 9fa59beb9a..8e196c8fa4 100644 --- a/components/tachart/taseries.pas +++ b/components/tachart/taseries.pas @@ -29,7 +29,7 @@ unit TASeries; interface uses - Classes, Graphics, LCLProc, + Classes, Graphics, TAChartUtils, TACustomSeries, TAGraph, TALegend, TATypes; type @@ -1114,7 +1114,7 @@ end; procedure TFuncSeries.SetOnCalculate(const AValue: TFuncCalculateEvent); begin - if CompareMethods(TMethod(FOnCalculate),TMethod(AValue)) then exit; + if TMethod(FOnCalculate) = TMethod(AValue) then exit; FOnCalculate := AValue; UpdateParentChart; end; @@ -1163,7 +1163,7 @@ end; procedure TUserDrawnSeries.SetOnDraw(AValue: TSeriesDrawEvent); begin - if CompareMethods(TMethod(FOnDraw),TMethod(AValue)) then exit; + if TMethod(FOnDraw) = TMethod(AValue) then exit; FOnDraw := AValue; UpdateParentChart; end; diff --git a/components/tachart/tasources.pas b/components/tachart/tasources.pas index 1ea071fae9..3564c52374 100644 --- a/components/tachart/tasources.pas +++ b/components/tachart/tasources.pas @@ -22,7 +22,7 @@ unit TASources; interface uses - Classes, LCLProc, Graphics, SysUtils, TAChartUtils; + Classes, Graphics, SysUtils, TAChartUtils; type EEditableSourceRequired = class(EChartError); @@ -783,7 +783,7 @@ end; procedure TUserDefinedChartSource.SetOnGetChartDataItem( const AValue: TGetChartDataItemEvent); begin - if CompareMethods(TMethod(FOnGetChartDataItem),TMethod(AValue)) then exit; + if TMethod(FOnGetChartDataItem) = TMethod(AValue) then exit; FOnGetChartDataItem := AValue; Reset; end;