LCL: take CharCase into account in TCustomEdit.RealSetText. Prevents unneccessary OnChanges and fixes infinite OnChange loop. Issue #0037313.

git-svn-id: trunk@63542 -
This commit is contained in:
bart 2020-07-11 10:16:10 +00:00
parent 1f0ff07dc2
commit b3ba26f89d

View File

@ -560,13 +560,30 @@ begin
end;
procedure TCustomEdit.RealSetText(const AValue: TCaption);
var
Temp: TCaption;
begin
Temp:=AValue;
{
case
CharCase of
ecNormal: Temp := AValue; //if Text=AValue SetText won't call RealSetText, so no need to check
ecUpperCase: begin
Temp := Utf8UpperCase(AValue);
if (Temp = RealGetText) then Exit;
end;
ecLowerCase: begin
Temp := Utf8LowerCase(AValue);
if (Temp = RealGetText) then Exit;
end;
end;
}
if (FEmulatedTextHintStatus=thsShowing) and (AValue<>'') then
HideEmulatedTextHint;
FTextChangedByRealSetText := True;
Modified := False;
inherited RealSetText(AValue);
inherited RealSetText(Temp);
FTextChangedByRealSetText := False;
if (FEmulatedTextHintStatus=thsHidden) and CanShowEmulatedTextHint then