mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 08:39:35 +02:00
LCL: Prevent TCustomEdit.OnChange firing extra time when CharCase is ecLowerCase or ecUpperCase. Issue #32630, patch from accorp.
git-svn-id: trunk@56288 -
This commit is contained in:
parent
534586feff
commit
b5b61d1a93
@ -82,6 +82,7 @@ begin
|
||||
FAutoSelect := True;
|
||||
FAutoSelected := False;
|
||||
FTextChangedByRealSetTextCounter := 0;
|
||||
FTextChangingCounter := 0;
|
||||
AutoSize := True;
|
||||
// Accessibility
|
||||
AccessibleRole := larTextEditorSingleline;
|
||||
@ -578,6 +579,8 @@ var
|
||||
SStart, SLen: Integer;
|
||||
begin
|
||||
//debugln('TCustomEdit.TextChanged ',DbgSName(Self));
|
||||
if FTextChangingCounter > 0 then
|
||||
Exit;
|
||||
if FCharCase in [ecUppercase, ecLowercase] then
|
||||
begin
|
||||
// use a local variable to reduce amounts of widgetset calls
|
||||
@ -592,7 +595,12 @@ begin
|
||||
CPos := CaretPos;
|
||||
SStart := SelStart;
|
||||
SLen := SelLength;
|
||||
Text := Temp;
|
||||
Inc(FTextChangingCounter);
|
||||
try
|
||||
Text := Temp;
|
||||
finally
|
||||
Dec(FTextChangingCounter);
|
||||
end;
|
||||
SelStart := SStart;
|
||||
SelLength := SLen;
|
||||
CaretPos := CPos;
|
||||
|
@ -730,6 +730,7 @@ type
|
||||
FSelLength: integer;
|
||||
FSelStart: integer;
|
||||
FTextChangedByRealSetTextCounter: Integer;
|
||||
FTextChangingCounter: integer;
|
||||
FTextHint: TTranslateString;
|
||||
procedure ShowEmulatedTextHint(const ForceShow: Boolean = False);
|
||||
procedure HideEmulatedTextHint;
|
||||
|
Loading…
Reference in New Issue
Block a user