mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-20 12:19:31 +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)
|
||||
private
|
||||
function GetFirstCharacterColumn(index: Integer): Byte;
|
||||
procedure TextBufferChanged(Sender: TSynEditStrings; aIndex, aCount: Integer
|
||||
);
|
||||
procedure TextBufferChanged(Sender: TObject);
|
||||
private
|
||||
FHighlighter: TSynCustomFoldHighlighter;
|
||||
FNestList: TLazSynEditNestedFoldsList;
|
||||
@ -190,7 +189,7 @@ begin
|
||||
if Assigned(Lines) then begin
|
||||
Lines.RemoveChangeHandler(senrLineCount, @LinesChanged);
|
||||
Lines.RemoveChangeHandler(senrHighlightChanged, @HighlightChanged);
|
||||
Lines.RemoveChangeHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||
Lines.RemoveNotifyHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||
end;
|
||||
FreeAndNil(FNestList);
|
||||
inherited Destroy;
|
||||
@ -290,8 +289,7 @@ begin
|
||||
Result := TCustomSynEdit(SynEdit).LogicalToPhysicalPos(Point(p, toPos(index))).x;
|
||||
end;
|
||||
|
||||
procedure TSynEditMarkupFoldColors.TextBufferChanged(Sender: TSynEditStrings;
|
||||
aIndex, aCount: Integer);
|
||||
procedure TSynEditMarkupFoldColors.TextBufferChanged(Sender: TObject);
|
||||
begin
|
||||
if not Enabled then
|
||||
exit;
|
||||
@ -822,7 +820,7 @@ begin
|
||||
// remove Changehandler
|
||||
old.RemoveChangeHandler(senrLineCount, @LinesChanged);
|
||||
old.RemoveChangeHandler(senrHighlightChanged, @HighlightChanged);
|
||||
old.RemoveChangeHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||
old.RemoveNotifyHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||
ClearCache;
|
||||
end;
|
||||
end;
|
||||
@ -834,7 +832,7 @@ begin
|
||||
// add Changehandler
|
||||
AValue.AddChangeHandler(senrLineCount, @LinesChanged);
|
||||
AValue.AddChangeHandler(senrHighlightChanged, @HighlightChanged);
|
||||
AValue.AddChangeHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||
AValue.AddNotifyHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||
InitCache;
|
||||
end else begin
|
||||
// clear cache
|
||||
@ -935,7 +933,7 @@ begin
|
||||
// add Changehandler
|
||||
Lines.AddChangeHandler(senrLineCount, @LinesChanged);
|
||||
Lines.AddChangeHandler(senrHighlightChanged, @HighlightChanged);
|
||||
Lines.AddChangeHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||
Lines.AddNotifyHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||
InitCache;
|
||||
end;
|
||||
end else begin
|
||||
@ -946,7 +944,7 @@ begin
|
||||
// remove Changehandler
|
||||
Lines.RemoveChangeHandler(senrLineCount, @LinesChanged);
|
||||
Lines.RemoveChangeHandler(senrHighlightChanged, @HighlightChanged);
|
||||
Lines.RemoveChangeHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||
Lines.RemoveNotifyHandler(senrTextBufferChanged, @TextBufferChanged);
|
||||
ClearCache;
|
||||
end;
|
||||
end;
|
||||
|
@ -631,7 +631,7 @@ end;
|
||||
|
||||
function TChartAxis.IsDefaultPosition: Boolean;
|
||||
begin
|
||||
Result := (PositionUnits = cuPercent) and (Position = 0);
|
||||
Result := (PositionUnits = cuPercent) and SameValue(Position, 0.0);
|
||||
end;
|
||||
|
||||
function TChartAxis.IsFlipped: Boolean;
|
||||
@ -781,7 +781,7 @@ end;
|
||||
|
||||
function TChartAxis.PositionIsStored: Boolean;
|
||||
begin
|
||||
Result := Position <> 0;
|
||||
Result := not SameValue(Position, 0.0);
|
||||
end;
|
||||
|
||||
function TChartAxis.PositionToCoord(const ARect: TRect): Integer;
|
||||
@ -914,7 +914,7 @@ end;
|
||||
|
||||
procedure TChartAxis.SetPosition(AValue: Double);
|
||||
begin
|
||||
if FPosition = AValue then exit;
|
||||
if SameValue(FPosition, AValue) then exit;
|
||||
FPosition := AValue;
|
||||
StyleChanged(Self);
|
||||
end;
|
||||
|
@ -709,17 +709,17 @@ end;
|
||||
|
||||
function TParametricCurveSeries.ParamMaxIsStored: Boolean;
|
||||
begin
|
||||
Result := ParamMax <> DEF_PARAM_MAX;
|
||||
Result := not SameValue(ParamMax, DEF_PARAM_MAX);
|
||||
end;
|
||||
|
||||
function TParametricCurveSeries.ParamMaxStepIsStored: Boolean;
|
||||
begin
|
||||
Result := ParamMaxStep > 0;
|
||||
Result := not SameValue(ParamMaxStep, 0.0) and (ParamMaxStep > 0);
|
||||
end;
|
||||
|
||||
function TParametricCurveSeries.ParamMinIsStored: Boolean;
|
||||
begin
|
||||
Result := ParamMin <> DEF_PARAM_MIN;
|
||||
Result := not SameValue(ParamMin, DEF_PARAM_MIN);
|
||||
end;
|
||||
|
||||
procedure TParametricCurveSeries.SetOnCalculate(
|
||||
@ -732,21 +732,21 @@ end;
|
||||
|
||||
procedure TParametricCurveSeries.SetParamMax(AValue: Double);
|
||||
begin
|
||||
if FParamMax = AValue then exit;
|
||||
if SameValue(FParamMax, AValue) then exit;
|
||||
FParamMax := AValue;
|
||||
UpdateParentChart;
|
||||
end;
|
||||
|
||||
procedure TParametricCurveSeries.SetParamMaxStep(AValue: Double);
|
||||
begin
|
||||
if FParamMaxStep = AValue then exit;
|
||||
if SameValue(FParamMaxStep, AValue) then exit;
|
||||
FParamMaxStep := AValue;
|
||||
UpdateParentChart;
|
||||
end;
|
||||
|
||||
procedure TParametricCurveSeries.SetParamMin(AValue: Double);
|
||||
begin
|
||||
if FParamMin = AValue then exit;
|
||||
if SameValue(FParamMin, AValue) then exit;
|
||||
FParamMin := AValue;
|
||||
UpdateParentChart;
|
||||
end;
|
||||
|
@ -772,12 +772,12 @@ end;
|
||||
|
||||
function TPolarSeries.IsOriginXStored: Boolean;
|
||||
begin
|
||||
Result := OriginX <> 0;
|
||||
Result := not SameValue(OriginX, 0.0);
|
||||
end;
|
||||
|
||||
function TPolarSeries.IsOriginYStored: Boolean;
|
||||
begin
|
||||
Result := OriginY <> 0;
|
||||
Result := not SameValue(OriginY, 0.0);
|
||||
end;
|
||||
|
||||
{ ANewPos is in cartesioan coordinates. Convert to polar coordinates and store
|
||||
@ -859,14 +859,14 @@ end;
|
||||
|
||||
procedure TPolarSeries.SetOriginX(AValue: Double);
|
||||
begin
|
||||
if FOriginX = AValue then exit;
|
||||
if SameValue(FOriginX, AValue) then exit;
|
||||
FOriginX := AValue;
|
||||
UpdateParentChart;
|
||||
end;
|
||||
|
||||
procedure TPolarSeries.SetOriginY(AValue: Double);
|
||||
begin
|
||||
if FOriginY = AValue then exit;
|
||||
if SameValue(FOriginY, AValue) then exit;
|
||||
FOriginY := AValue;
|
||||
UpdateParentChart;
|
||||
end;
|
||||
|
@ -600,26 +600,26 @@ end;
|
||||
|
||||
function TLinearAxisTransform. OffsetIsStored: Boolean;
|
||||
begin
|
||||
Result := Offset <> 0;
|
||||
Result := not SameValue(Offset, 0.0);
|
||||
end;
|
||||
|
||||
function TLinearAxisTransform.ScaleIsStored: Boolean;
|
||||
begin
|
||||
Result := Scale <> 1.0;
|
||||
Result := not SameValue(Scale, 1.0);
|
||||
end;
|
||||
|
||||
procedure TLinearAxisTransform.SetOffset(AValue: Double);
|
||||
begin
|
||||
if FOffset = AValue then exit;
|
||||
if SameValue(FOffset, AValue) then exit;
|
||||
FOffset := AValue;
|
||||
Changed;
|
||||
end;
|
||||
|
||||
procedure TLinearAxisTransform.SetScale(AValue: Double);
|
||||
begin
|
||||
if FScale = AValue then exit;
|
||||
if SameValue(FScale, AValue) then exit;
|
||||
FScale := AValue;
|
||||
if FScale = 0 then FScale := 1.0;
|
||||
if SameValue(FScale, 0.0) then FScale := 1.0;
|
||||
Changed;
|
||||
end;
|
||||
|
||||
|
@ -579,7 +579,7 @@ end;
|
||||
|
||||
function TChartRange.IsBoundsStored(AIndex: Integer): Boolean;
|
||||
begin
|
||||
Result := FBounds[AIndex] <> 0;
|
||||
Result := not SameValue(FBounds[AIndex], 0);
|
||||
end;
|
||||
|
||||
procedure TChartRange.SetBounds(AIndex: Integer; const AValue: Double);
|
||||
@ -639,7 +639,7 @@ end;
|
||||
|
||||
function TChartExtent.IsBoundsStored(AIndex: Integer): Boolean;
|
||||
begin
|
||||
Result := FExtent.coords[AIndex] <> 0;
|
||||
Result := not SameValue(FExtent.coords[AIndex], 0.0);
|
||||
end;
|
||||
|
||||
procedure TChartExtent.SetBounds(AIndex: Integer; const AValue: Double);
|
||||
|
Loading…
Reference in New Issue
Block a user