From c4f86163713ea7584dc19460e53b68984798d8bc Mon Sep 17 00:00:00 2001 From: juha Date: Fri, 24 Nov 2017 20:44:02 +0000 Subject: [PATCH] LCL: Change a counter to boolean FTextChangedLock, used for firing events right. Issue #32630. git-svn-id: trunk@56489 - --- lcl/include/customedit.inc | 8 ++++---- lcl/stdctrls.pp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lcl/include/customedit.inc b/lcl/include/customedit.inc index d2a948f94c..0f923a2bbc 100644 --- a/lcl/include/customedit.inc +++ b/lcl/include/customedit.inc @@ -82,7 +82,7 @@ begin FAutoSelect := True; FAutoSelected := False; FTextChangedByRealSetText := False; - FTextChangingCounter := 0; + FTextChangedLock := False; AutoSize := True; // Accessibility AccessibleRole := larTextEditorSingleline; @@ -578,7 +578,7 @@ var SStart, SLen: Integer; begin //debugln('TCustomEdit.TextChanged ',DbgSName(Self)); - if FTextChangingCounter > 0 then + if FTextChangedLock then Exit; if FCharCase in [ecUppercase, ecLowercase] then begin @@ -594,11 +594,11 @@ begin CPos := CaretPos; SStart := SelStart; SLen := SelLength; - Inc(FTextChangingCounter); + FTextChangedLock := True; try Text := Temp; finally - Dec(FTextChangingCounter); + FTextChangedLock := False; end; SelStart := SStart; SelLength := SLen; diff --git a/lcl/stdctrls.pp b/lcl/stdctrls.pp index 48f49ddf7c..de1e109555 100644 --- a/lcl/stdctrls.pp +++ b/lcl/stdctrls.pp @@ -730,7 +730,7 @@ type FSelLength: integer; FSelStart: integer; FTextChangedByRealSetText: Boolean; - FTextChangingCounter: integer; + FTextChangedLock: Boolean; FTextHint: TTranslateString; procedure ShowEmulatedTextHint(const ForceShow: Boolean = False); procedure HideEmulatedTextHint;