TAChart: Remove "const" from some parameters where it is unneeded or dangerous

git-svn-id: trunk@31673 -
This commit is contained in:
ask 2011-07-12 08:03:40 +00:00
parent 5c92f7cdaf
commit 9ddaa28a8f
11 changed files with 68 additions and 68 deletions

View File

@ -109,7 +109,7 @@ type
procedure SetOnMarkToText(AValue: TChartAxisMarkToTextEvent);
procedure SetTitle(AValue: TChartAxisTitle);
procedure SetTransformations(AValue: TChartAxisTransformations);
procedure SetZPosition(const AValue: TChartDistance);
procedure SetZPosition(AValue: TChartDistance);
protected
function GetDisplayName: String; override;
@ -622,7 +622,7 @@ begin
StyleChanged(Self);
end;
procedure TChartAxis.SetZPosition(const AValue: TChartDistance);
procedure TChartAxis.SetZPosition(AValue: TChartDistance);
begin
if FZPosition = AValue then exit;
FZPosition := AValue;

View File

@ -117,8 +117,8 @@ type
function GetSource: TCustomChartSource;
function IsSourceStored: boolean;
procedure SetMarks(const AValue: TChartMarks);
procedure SetOnGetMark(const AValue: TChartGetMarkEvent);
procedure SetMarks(AValue: TChartMarks);
procedure SetOnGetMark(AValue: TChartGetMarkEvent);
procedure SetSource(AValue: TCustomChartSource);
procedure SetStyles(AValue: TChartStyles);
protected
@ -713,13 +713,13 @@ begin
end;
end;
procedure TChartSeries.SetMarks(const AValue: TChartMarks);
procedure TChartSeries.SetMarks(AValue: TChartMarks);
begin
if FMarks = AValue then exit;
FMarks.Assign(AValue);
end;
procedure TChartSeries.SetOnGetMark(const AValue: TChartGetMarkEvent);
procedure TChartSeries.SetOnGetMark(AValue: TChartGetMarkEvent);
begin
if TMethod(FOnGetMark) = TMethod(AValue) then exit;
FOnGetMark := AValue;

View File

@ -56,7 +56,7 @@ type
function Pos(AX, AY: Integer): TChartTextOut;
function Pos(const APos: TPoint): TChartTextOut;
function Text(const AText: String): TChartTextOut;
function Text(const AText: TStrings): TChartTextOut;
function Text(AText: TStrings): TChartTextOut;
function Width(AWidth: Integer): TChartTextOut;
end;
@ -266,7 +266,7 @@ begin
Result := Self;
end;
function TChartTextOut.Text(const AText: TStrings): TChartTextOut;
function TChartTextOut.Text(AText: TStrings): TChartTextOut;
begin
FText2 := AText;
Result := Self;

View File

@ -69,8 +69,8 @@ type
function DoCalcIdentity(AX: Double): Double;
function DoCalculate(AX: Double): Double;
procedure SetOnCalculate(const AValue: TFuncCalculateEvent);
procedure SetPen(const AValue: TChartPen);
procedure SetOnCalculate(AValue: TFuncCalculateEvent);
procedure SetPen(AValue: TChartPen);
procedure SetStep(AValue: TFuncSeriesStep);
protected
procedure GetLegendItems(AItems: TChartLegendItems); override;
@ -459,14 +459,14 @@ begin
Result := not Assigned(OnCalculate);
end;
procedure TFuncSeries.SetOnCalculate(const AValue: TFuncCalculateEvent);
procedure TFuncSeries.SetOnCalculate(AValue: TFuncCalculateEvent);
begin
if TMethod(FOnCalculate) = TMethod(AValue) then exit;
FOnCalculate := AValue;
UpdateParentChart;
end;
procedure TFuncSeries.SetPen(const AValue: TChartPen);
procedure TFuncSeries.SetPen(AValue: TChartPen);
begin
if FPen = AValue then exit;
FPen.Assign(AValue);

View File

@ -215,7 +215,7 @@ type
procedure SetBackColor(AValue: TColor);
procedure SetDepth(AValue: TChartDistance);
procedure SetExpandPercentage(AValue: Integer);
procedure SetExtent(const AValue: TChartExtent);
procedure SetExtent(AValue: TChartExtent);
procedure SetFoot(Value: TChartTitle);
procedure SetFrame(Value: TChartPen);
procedure SetGraphBrush(Value: TBrush);
@ -231,7 +231,7 @@ type
procedure SetOnDrawReticule(AValue: TDrawReticuleEvent);
procedure SetProportional(AValue: Boolean);
procedure SetRenderingParams(AValue: TChartRenderingParams);
procedure SetReticuleMode(const AValue: TReticuleMode);
procedure SetReticuleMode(AValue: TReticuleMode);
procedure SetReticulePos(const AValue: TPoint);
procedure SetTitle(Value: TChartTitle);
procedure SetToolset(AValue: TBasicChartToolset);
@ -286,7 +286,7 @@ type
procedure PaintOnAuxCanvas(ACanvas: TCanvas; ARect: TRect);
procedure PaintOnCanvas(ACanvas: TCanvas; ARect: TRect);
procedure SaveToBitmapFile(const AFileName: String); inline;
procedure SaveToFile(AClass: TRasterImageClass; const AFileName: String);
procedure SaveToFile(AClass: TRasterImageClass; AFileName: String);
function SaveToImage(AClass: TRasterImageClass): TRasterImage;
procedure StyleChanged(Sender: TObject); override;
procedure ZoomFull; override;
@ -1132,7 +1132,7 @@ begin
SaveToFile(TBitmap, AFileName);
end;
procedure TChart.SaveToFile(AClass: TRasterImageClass; const AFileName: String);
procedure TChart.SaveToFile(AClass: TRasterImageClass; AFileName: String);
begin
with SaveToImage(AClass) do
try
@ -1209,7 +1209,7 @@ begin
StyleChanged(Self);
end;
procedure TChart.SetExtent(const AValue: TChartExtent);
procedure TChart.SetExtent(AValue: TChartExtent);
begin
FExtent.Assign(AValue);
StyleChanged(Self);
@ -1330,7 +1330,7 @@ begin
FIsZoomed := AValue.FIsZoomed;
end;
procedure TChart.SetReticuleMode(const AValue: TReticuleMode);
procedure TChart.SetReticuleMode(AValue: TReticuleMode);
begin
if FReticuleMode = AValue then exit;
FReticuleMode := AValue;

View File

@ -166,7 +166,7 @@ type
procedure SetColumnCount(AValue: TLegendColumnCount);
procedure SetFont(AValue: TFont);
procedure SetFrame(AValue: TChartPen);
procedure SetGroupFont(const AValue: TFont);
procedure SetGroupFont(AValue: TFont);
procedure SetGroupTitles(AValue: TStrings);
procedure SetMargin(AValue: TChartDistance);
procedure SetMarginX(AValue: TChartDistance);
@ -619,7 +619,7 @@ begin
StyleChanged(Self);
end;
procedure TChartLegend.SetGroupFont(const AValue: TFont);
procedure TChartLegend.SetGroupFont(AValue: TFont);
begin
FGroupFont.Assign(AValue);
StyleChanged(Self);

View File

@ -74,7 +74,7 @@ type
TMWCRandomGenerator = class
private
FHistory: array [0..4] of LongWord;
procedure SetSeed(const AValue: Integer);
procedure SetSeed(AValue: Integer);
public
function Get: LongWord;
function GetInRange(AMin, AMax: Integer): Integer;
@ -97,13 +97,13 @@ type
FCurItem: TChartDataItem;
FRNG: TMWCRandomGenerator;
procedure SetPointsNumber(const AValue: Integer);
procedure SetRandomX(const AValue: Boolean);
procedure SetRandSeed(const AValue: Integer);
procedure SetXMax(const AValue: Double);
procedure SetXMin(const AValue: Double);
procedure SetYMax(const AValue: Double);
procedure SetYMin(const AValue: Double);
procedure SetPointsNumber(AValue: Integer);
procedure SetRandomX(AValue: Boolean);
procedure SetRandSeed(AValue: Integer);
procedure SetXMax(AValue: Double);
procedure SetXMin(AValue: Double);
procedure SetYMax(AValue: Double);
procedure SetYMin(AValue: Double);
protected
function GetCount: Integer; override;
function GetItem(AIndex: Integer): PChartDataItem; override;
@ -139,8 +139,8 @@ type
FOnGetChartDataItem: TGetChartDataItemEvent;
FPointsNumber: Integer;
FSorted: Boolean;
procedure SetOnGetChartDataItem(const AValue: TGetChartDataItemEvent);
procedure SetPointsNumber(const AValue: Integer);
procedure SetOnGetChartDataItem(AValue: TGetChartDataItemEvent);
procedure SetPointsNumber(AValue: Integer);
protected
function GetCount: Integer; override;
function GetItem(AIndex: Integer): PChartDataItem; override;
@ -220,7 +220,7 @@ type
TListChartSourceStrings = class(TStrings)
private
FSource: TListChartSource;
procedure Parse(const AString: String; ADataItem: PChartDataItem);
procedure Parse(AString: String; ADataItem: PChartDataItem);
protected
function Get(Index: Integer): String; override;
function GetCount: Integer; override;
@ -286,7 +286,7 @@ begin
end;
procedure TListChartSourceStrings.Parse(
const AString: String; ADataItem: PChartDataItem);
AString: String; ADataItem: PChartDataItem);
var
p: Integer = 0;
parts: TStringList;
@ -623,7 +623,7 @@ begin
Result := Integer(Hi(m)) + AMin;
end;
procedure TMWCRandomGenerator.SetSeed(const AValue: Integer);
procedure TMWCRandomGenerator.SetSeed(AValue: Integer);
var
i: Integer;
begin
@ -701,7 +701,7 @@ begin
Result := not RandomX;
end;
procedure TRandomChartSource.SetPointsNumber(const AValue: Integer);
procedure TRandomChartSource.SetPointsNumber(AValue: Integer);
begin
if FPointsNumber = AValue then exit;
FPointsNumber := AValue;
@ -709,7 +709,7 @@ begin
Notify;
end;
procedure TRandomChartSource.SetRandomX(const AValue: Boolean);
procedure TRandomChartSource.SetRandomX(AValue: Boolean);
begin
if FRandomX = AValue then exit;
FRandomX := AValue;
@ -717,7 +717,7 @@ begin
Notify;
end;
procedure TRandomChartSource.SetRandSeed(const AValue: Integer);
procedure TRandomChartSource.SetRandSeed(AValue: Integer);
begin
if FRandSeed = AValue then exit;
FRandSeed := AValue;
@ -727,7 +727,7 @@ begin
Notify;
end;
procedure TRandomChartSource.SetXMax(const AValue: Double);
procedure TRandomChartSource.SetXMax(AValue: Double);
begin
if FXMax = AValue then exit;
FXMax := AValue;
@ -735,7 +735,7 @@ begin
Notify;
end;
procedure TRandomChartSource.SetXMin(const AValue: Double);
procedure TRandomChartSource.SetXMin(AValue: Double);
begin
if FXMin = AValue then exit;
FXMin := AValue;
@ -751,7 +751,7 @@ begin
Notify;
end;
procedure TRandomChartSource.SetYMax(const AValue: Double);
procedure TRandomChartSource.SetYMax(AValue: Double);
begin
if FYMax = AValue then exit;
FYMax := AValue;
@ -759,7 +759,7 @@ begin
Notify;
end;
procedure TRandomChartSource.SetYMin(const AValue: Double);
procedure TRandomChartSource.SetYMin(AValue: Double);
begin
if FYMin = AValue then exit;
FYMin := AValue;
@ -802,14 +802,14 @@ begin
end;
procedure TUserDefinedChartSource.SetOnGetChartDataItem(
const AValue: TGetChartDataItemEvent);
AValue: TGetChartDataItemEvent);
begin
if TMethod(FOnGetChartDataItem) = TMethod(AValue) then exit;
FOnGetChartDataItem := AValue;
Reset;
end;
procedure TUserDefinedChartSource.SetPointsNumber(const AValue: Integer);
procedure TUserDefinedChartSource.SetPointsNumber(AValue: Integer);
begin
if FPointsNumber = AValue then exit;
FPointsNumber := AValue;

View File

@ -33,8 +33,8 @@ type
FRepeatCount: Cardinal;
FUseBrush: Boolean;
FUsePen: Boolean;
procedure SetBrush(const AValue: TBrush);
procedure SetPen(const AValue: TPen);
procedure SetBrush(AValue: TBrush);
procedure SetPen(AValue: TPen);
procedure SetRepeatCount(AValue: Cardinal);
procedure SetUseBrush(AValue: Boolean);
procedure SetUsePen(AValue: Boolean);
@ -143,13 +143,13 @@ begin
Result := inherited GetDisplayName;
end;
procedure TChartStyle.SetBrush(const AValue: TBrush);
procedure TChartStyle.SetBrush(AValue: TBrush);
begin
if FBrush = AValue then exit;
FBrush := AValue;
end;
procedure TChartStyle.SetPen(const AValue: TPen);
procedure TChartStyle.SetPen(AValue: TPen);
begin
if FPen = AValue then exit;
FPen := AValue;

View File

@ -42,8 +42,8 @@ type
FEventsBefore: array [TChartToolEventId] of TChartToolEvent;
FShift: TShiftState;
FToolset: TChartToolset;
procedure SetActiveCursor(const AValue: TCursor);
procedure SetToolset(const AValue: TChartToolset);
procedure SetActiveCursor(AValue: TCursor);
procedure SetToolset(AValue: TChartToolset);
private
FOldCursor: TCursor;
function GetAfterEvent(AIndex: Integer): TChartToolEvent;
@ -635,7 +635,7 @@ begin
FChart.Cursor := FOldCursor;
end;
procedure TChartTool.SetActiveCursor(const AValue: TCursor);
procedure TChartTool.SetActiveCursor(AValue: TCursor);
begin
if FActiveCursor = AValue then exit;
if IsActive then
@ -673,7 +673,7 @@ begin
Toolset := AParent as TChartToolset;
end;
procedure TChartTool.SetToolset(const AValue: TChartToolset);
procedure TChartTool.SetToolset(AValue: TChartToolset);
begin
if FToolset = AValue then exit;
if FToolset <> nil then

View File

@ -129,8 +129,8 @@ type
FMinValue: Double;
function MaxValueIsStored: boolean;
function MinValueIsStored: boolean;
procedure SetMaxValue(const AValue: Double);
procedure SetMinValue(const AValue: Double);
procedure SetMaxValue(AValue: Double);
procedure SetMinValue(AValue: Double);
protected
procedure ClearBounds; override;
function GetDrawDataClass: TDrawDataItemClass; override;
@ -692,14 +692,14 @@ begin
Result := MinValue <> 0.0;
end;
procedure TAutoScaleAxisTransform.SetMaxValue(const AValue: Double);
procedure TAutoScaleAxisTransform.SetMaxValue(AValue: Double);
begin
if FMaxValue = AValue then exit;
FMaxValue := AValue;
Changed;
end;
procedure TAutoScaleAxisTransform.SetMinValue(const AValue: Double);
procedure TAutoScaleAxisTransform.SetMinValue(AValue: Double);
begin
if FMinValue = AValue then exit;
FMinValue := AValue;

View File

@ -67,7 +67,7 @@ type
TChartElement = class(TPersistent)
protected
FVisible: Boolean;
procedure SetVisible(const AValue: Boolean);
procedure SetVisible(AValue: Boolean);
protected
FOwner: TCustomChart;
function GetOwner: TPersistent; override;
@ -154,13 +154,13 @@ type
procedure SetClipped(AValue: Boolean);
procedure SetDistance(AValue: TChartDistance);
procedure SetFormat(const AValue: String);
procedure SetFrame(const AValue: _TFramePen);
procedure SetLabelBrush(const AValue: _TLabelBrush);
procedure SetLabelFont(const AValue: TFont);
procedure SetLinkPen(const AValue: _TLinkPen);
procedure SetFormat(AValue: String);
procedure SetFrame(AValue: _TFramePen);
procedure SetLabelBrush(AValue: _TLabelBrush);
procedure SetLabelFont(AValue: TFont);
procedure SetLinkPen(AValue: _TLinkPen);
procedure SetOverlapPolicy(AValue: TChartMarksOverlapPolicy);
procedure SetStyle(const AValue: TSeriesMarksStyle);
procedure SetStyle(AValue: TSeriesMarksStyle);
protected
function IsMarginRequired: Boolean;
public
@ -382,7 +382,7 @@ begin
FOwner := AOwner;
end;
procedure TChartElement.SetVisible(const AValue: Boolean);
procedure TChartElement.SetVisible(AValue: Boolean);
begin
if FVisible = AValue then exit;
FVisible := AValue;
@ -678,7 +678,7 @@ begin
Attachment := maDefault;
end;
procedure TGenericChartMarks.SetFormat(const AValue: String);
procedure TGenericChartMarks.SetFormat(AValue: String);
begin
if FFormat = AValue then exit;
TCustomChartSource.CheckFormat(AValue);
@ -689,28 +689,28 @@ begin
StyleChanged(Self);
end;
procedure TGenericChartMarks.SetFrame(const AValue: _TFramePen);
procedure TGenericChartMarks.SetFrame(AValue: _TFramePen);
begin
if FFrame = AValue then exit;
FFrame.Assign(AValue);
StyleChanged(Self);
end;
procedure TGenericChartMarks.SetLabelBrush(const AValue: _TLabelBrush);
procedure TGenericChartMarks.SetLabelBrush(AValue: _TLabelBrush);
begin
if FLabelBrush = AValue then exit;
FLabelBrush.Assign(AValue);
StyleChanged(Self);
end;
procedure TGenericChartMarks.SetLabelFont(const AValue: TFont);
procedure TGenericChartMarks.SetLabelFont(AValue: TFont);
begin
if FLabelFont = AValue then exit;
FLabelFont := AValue;
StyleChanged(Self);
end;
procedure TGenericChartMarks.SetLinkPen(const AValue: _TLinkPen);
procedure TGenericChartMarks.SetLinkPen(AValue: _TLinkPen);
begin
if FLinkPen = AValue then exit;
FLinkPen := AValue;
@ -724,7 +724,7 @@ begin
StyleChanged(Self);
end;
procedure TGenericChartMarks.SetStyle(const AValue: TSeriesMarksStyle);
procedure TGenericChartMarks.SetStyle(AValue: TSeriesMarksStyle);
begin
if FStyle = AValue then exit;
FStyle := AValue;