mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 19:56:22 +02:00
Merged revision(s) 55104 #92595f0745, 55106 #cb676c2241 from trunk:
TAChart: Use SameValue in floating point comparisons. ........ SynEdit: MarkupFoldColor, fixed crash due to wrong method signature. ........ git-svn-id: branches/fixes_1_8@55107 -
This commit is contained in:
parent
8f86076ace
commit
c849f1f138
@ -72,8 +72,7 @@ type
|
|||||||
TSynEditMarkupFoldColors = class(TSynEditMarkup)
|
TSynEditMarkupFoldColors = class(TSynEditMarkup)
|
||||||
private
|
private
|
||||||
function GetFirstCharacterColumn(index: Integer): Byte;
|
function GetFirstCharacterColumn(index: Integer): Byte;
|
||||||
procedure TextBufferChanged(Sender: TSynEditStrings; aIndex, aCount: Integer
|
procedure TextBufferChanged(Sender: TObject);
|
||||||
);
|
|
||||||
private
|
private
|
||||||
FHighlighter: TSynCustomFoldHighlighter;
|
FHighlighter: TSynCustomFoldHighlighter;
|
||||||
FNestList: TLazSynEditNestedFoldsList;
|
FNestList: TLazSynEditNestedFoldsList;
|
||||||
@ -190,7 +189,7 @@ begin
|
|||||||
if Assigned(Lines) then begin
|
if Assigned(Lines) then begin
|
||||||
Lines.RemoveChangeHandler(senrLineCount, @LinesChanged);
|
Lines.RemoveChangeHandler(senrLineCount, @LinesChanged);
|
||||||
Lines.RemoveChangeHandler(senrHighlightChanged, @HighlightChanged);
|
Lines.RemoveChangeHandler(senrHighlightChanged, @HighlightChanged);
|
||||||
Lines.RemoveChangeHandler(senrTextBufferChanged, @TextBufferChanged);
|
Lines.RemoveNotifyHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||||
end;
|
end;
|
||||||
FreeAndNil(FNestList);
|
FreeAndNil(FNestList);
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
@ -290,8 +289,7 @@ begin
|
|||||||
Result := TCustomSynEdit(SynEdit).LogicalToPhysicalPos(Point(p, toPos(index))).x;
|
Result := TCustomSynEdit(SynEdit).LogicalToPhysicalPos(Point(p, toPos(index))).x;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSynEditMarkupFoldColors.TextBufferChanged(Sender: TSynEditStrings;
|
procedure TSynEditMarkupFoldColors.TextBufferChanged(Sender: TObject);
|
||||||
aIndex, aCount: Integer);
|
|
||||||
begin
|
begin
|
||||||
if not Enabled then
|
if not Enabled then
|
||||||
exit;
|
exit;
|
||||||
@ -822,7 +820,7 @@ begin
|
|||||||
// remove Changehandler
|
// remove Changehandler
|
||||||
old.RemoveChangeHandler(senrLineCount, @LinesChanged);
|
old.RemoveChangeHandler(senrLineCount, @LinesChanged);
|
||||||
old.RemoveChangeHandler(senrHighlightChanged, @HighlightChanged);
|
old.RemoveChangeHandler(senrHighlightChanged, @HighlightChanged);
|
||||||
old.RemoveChangeHandler(senrTextBufferChanged, @TextBufferChanged);
|
old.RemoveNotifyHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||||
ClearCache;
|
ClearCache;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -834,7 +832,7 @@ begin
|
|||||||
// add Changehandler
|
// add Changehandler
|
||||||
AValue.AddChangeHandler(senrLineCount, @LinesChanged);
|
AValue.AddChangeHandler(senrLineCount, @LinesChanged);
|
||||||
AValue.AddChangeHandler(senrHighlightChanged, @HighlightChanged);
|
AValue.AddChangeHandler(senrHighlightChanged, @HighlightChanged);
|
||||||
AValue.AddChangeHandler(senrTextBufferChanged, @TextBufferChanged);
|
AValue.AddNotifyHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||||
InitCache;
|
InitCache;
|
||||||
end else begin
|
end else begin
|
||||||
// clear cache
|
// clear cache
|
||||||
@ -935,7 +933,7 @@ begin
|
|||||||
// add Changehandler
|
// add Changehandler
|
||||||
Lines.AddChangeHandler(senrLineCount, @LinesChanged);
|
Lines.AddChangeHandler(senrLineCount, @LinesChanged);
|
||||||
Lines.AddChangeHandler(senrHighlightChanged, @HighlightChanged);
|
Lines.AddChangeHandler(senrHighlightChanged, @HighlightChanged);
|
||||||
Lines.AddChangeHandler(senrTextBufferChanged, @TextBufferChanged);
|
Lines.AddNotifyHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||||
InitCache;
|
InitCache;
|
||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
@ -946,7 +944,7 @@ begin
|
|||||||
// remove Changehandler
|
// remove Changehandler
|
||||||
Lines.RemoveChangeHandler(senrLineCount, @LinesChanged);
|
Lines.RemoveChangeHandler(senrLineCount, @LinesChanged);
|
||||||
Lines.RemoveChangeHandler(senrHighlightChanged, @HighlightChanged);
|
Lines.RemoveChangeHandler(senrHighlightChanged, @HighlightChanged);
|
||||||
Lines.RemoveChangeHandler(senrTextBufferChanged, @TextBufferChanged);
|
Lines.RemoveNotifyHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||||
ClearCache;
|
ClearCache;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -631,7 +631,7 @@ end;
|
|||||||
|
|
||||||
function TChartAxis.IsDefaultPosition: Boolean;
|
function TChartAxis.IsDefaultPosition: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := (PositionUnits = cuPercent) and (Position = 0);
|
Result := (PositionUnits = cuPercent) and SameValue(Position, 0.0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TChartAxis.IsFlipped: Boolean;
|
function TChartAxis.IsFlipped: Boolean;
|
||||||
@ -781,7 +781,7 @@ end;
|
|||||||
|
|
||||||
function TChartAxis.PositionIsStored: Boolean;
|
function TChartAxis.PositionIsStored: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := Position <> 0;
|
Result := not SameValue(Position, 0.0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TChartAxis.PositionToCoord(const ARect: TRect): Integer;
|
function TChartAxis.PositionToCoord(const ARect: TRect): Integer;
|
||||||
@ -914,7 +914,7 @@ end;
|
|||||||
|
|
||||||
procedure TChartAxis.SetPosition(AValue: Double);
|
procedure TChartAxis.SetPosition(AValue: Double);
|
||||||
begin
|
begin
|
||||||
if FPosition = AValue then exit;
|
if SameValue(FPosition, AValue) then exit;
|
||||||
FPosition := AValue;
|
FPosition := AValue;
|
||||||
StyleChanged(Self);
|
StyleChanged(Self);
|
||||||
end;
|
end;
|
||||||
|
@ -709,17 +709,17 @@ end;
|
|||||||
|
|
||||||
function TParametricCurveSeries.ParamMaxIsStored: Boolean;
|
function TParametricCurveSeries.ParamMaxIsStored: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := ParamMax <> DEF_PARAM_MAX;
|
Result := not SameValue(ParamMax, DEF_PARAM_MAX);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TParametricCurveSeries.ParamMaxStepIsStored: Boolean;
|
function TParametricCurveSeries.ParamMaxStepIsStored: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := ParamMaxStep > 0;
|
Result := not SameValue(ParamMaxStep, 0.0) and (ParamMaxStep > 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TParametricCurveSeries.ParamMinIsStored: Boolean;
|
function TParametricCurveSeries.ParamMinIsStored: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := ParamMin <> DEF_PARAM_MIN;
|
Result := not SameValue(ParamMin, DEF_PARAM_MIN);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TParametricCurveSeries.SetOnCalculate(
|
procedure TParametricCurveSeries.SetOnCalculate(
|
||||||
@ -732,21 +732,21 @@ end;
|
|||||||
|
|
||||||
procedure TParametricCurveSeries.SetParamMax(AValue: Double);
|
procedure TParametricCurveSeries.SetParamMax(AValue: Double);
|
||||||
begin
|
begin
|
||||||
if FParamMax = AValue then exit;
|
if SameValue(FParamMax, AValue) then exit;
|
||||||
FParamMax := AValue;
|
FParamMax := AValue;
|
||||||
UpdateParentChart;
|
UpdateParentChart;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TParametricCurveSeries.SetParamMaxStep(AValue: Double);
|
procedure TParametricCurveSeries.SetParamMaxStep(AValue: Double);
|
||||||
begin
|
begin
|
||||||
if FParamMaxStep = AValue then exit;
|
if SameValue(FParamMaxStep, AValue) then exit;
|
||||||
FParamMaxStep := AValue;
|
FParamMaxStep := AValue;
|
||||||
UpdateParentChart;
|
UpdateParentChart;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TParametricCurveSeries.SetParamMin(AValue: Double);
|
procedure TParametricCurveSeries.SetParamMin(AValue: Double);
|
||||||
begin
|
begin
|
||||||
if FParamMin = AValue then exit;
|
if SameValue(FParamMin, AValue) then exit;
|
||||||
FParamMin := AValue;
|
FParamMin := AValue;
|
||||||
UpdateParentChart;
|
UpdateParentChart;
|
||||||
end;
|
end;
|
||||||
|
@ -772,12 +772,12 @@ end;
|
|||||||
|
|
||||||
function TPolarSeries.IsOriginXStored: Boolean;
|
function TPolarSeries.IsOriginXStored: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := OriginX <> 0;
|
Result := not SameValue(OriginX, 0.0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPolarSeries.IsOriginYStored: Boolean;
|
function TPolarSeries.IsOriginYStored: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := OriginY <> 0;
|
Result := not SameValue(OriginY, 0.0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ ANewPos is in cartesioan coordinates. Convert to polar coordinates and store
|
{ ANewPos is in cartesioan coordinates. Convert to polar coordinates and store
|
||||||
@ -859,14 +859,14 @@ end;
|
|||||||
|
|
||||||
procedure TPolarSeries.SetOriginX(AValue: Double);
|
procedure TPolarSeries.SetOriginX(AValue: Double);
|
||||||
begin
|
begin
|
||||||
if FOriginX = AValue then exit;
|
if SameValue(FOriginX, AValue) then exit;
|
||||||
FOriginX := AValue;
|
FOriginX := AValue;
|
||||||
UpdateParentChart;
|
UpdateParentChart;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPolarSeries.SetOriginY(AValue: Double);
|
procedure TPolarSeries.SetOriginY(AValue: Double);
|
||||||
begin
|
begin
|
||||||
if FOriginY = AValue then exit;
|
if SameValue(FOriginY, AValue) then exit;
|
||||||
FOriginY := AValue;
|
FOriginY := AValue;
|
||||||
UpdateParentChart;
|
UpdateParentChart;
|
||||||
end;
|
end;
|
||||||
|
@ -600,26 +600,26 @@ end;
|
|||||||
|
|
||||||
function TLinearAxisTransform. OffsetIsStored: Boolean;
|
function TLinearAxisTransform. OffsetIsStored: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := Offset <> 0;
|
Result := not SameValue(Offset, 0.0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLinearAxisTransform.ScaleIsStored: Boolean;
|
function TLinearAxisTransform.ScaleIsStored: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := Scale <> 1.0;
|
Result := not SameValue(Scale, 1.0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLinearAxisTransform.SetOffset(AValue: Double);
|
procedure TLinearAxisTransform.SetOffset(AValue: Double);
|
||||||
begin
|
begin
|
||||||
if FOffset = AValue then exit;
|
if SameValue(FOffset, AValue) then exit;
|
||||||
FOffset := AValue;
|
FOffset := AValue;
|
||||||
Changed;
|
Changed;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLinearAxisTransform.SetScale(AValue: Double);
|
procedure TLinearAxisTransform.SetScale(AValue: Double);
|
||||||
begin
|
begin
|
||||||
if FScale = AValue then exit;
|
if SameValue(FScale, AValue) then exit;
|
||||||
FScale := AValue;
|
FScale := AValue;
|
||||||
if FScale = 0 then FScale := 1.0;
|
if SameValue(FScale, 0.0) then FScale := 1.0;
|
||||||
Changed;
|
Changed;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -579,7 +579,7 @@ end;
|
|||||||
|
|
||||||
function TChartRange.IsBoundsStored(AIndex: Integer): Boolean;
|
function TChartRange.IsBoundsStored(AIndex: Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := FBounds[AIndex] <> 0;
|
Result := not SameValue(FBounds[AIndex], 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChartRange.SetBounds(AIndex: Integer; const AValue: Double);
|
procedure TChartRange.SetBounds(AIndex: Integer; const AValue: Double);
|
||||||
@ -639,7 +639,7 @@ end;
|
|||||||
|
|
||||||
function TChartExtent.IsBoundsStored(AIndex: Integer): Boolean;
|
function TChartExtent.IsBoundsStored(AIndex: Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := FExtent.coords[AIndex] <> 0;
|
Result := not SameValue(FExtent.coords[AIndex], 0.0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChartExtent.SetBounds(AIndex: Integer; const AValue: Double);
|
procedure TChartExtent.SetBounds(AIndex: Integer; const AValue: Double);
|
||||||
|
Loading…
Reference in New Issue
Block a user