mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 03:19:25 +02:00
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:
parent
1f0ff07dc2
commit
b3ba26f89d
@ -560,13 +560,30 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomEdit.RealSetText(const AValue: TCaption);
|
procedure TCustomEdit.RealSetText(const AValue: TCaption);
|
||||||
|
var
|
||||||
|
Temp: TCaption;
|
||||||
begin
|
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
|
if (FEmulatedTextHintStatus=thsShowing) and (AValue<>'') then
|
||||||
HideEmulatedTextHint;
|
HideEmulatedTextHint;
|
||||||
|
|
||||||
FTextChangedByRealSetText := True;
|
FTextChangedByRealSetText := True;
|
||||||
Modified := False;
|
Modified := False;
|
||||||
inherited RealSetText(AValue);
|
inherited RealSetText(Temp);
|
||||||
FTextChangedByRealSetText := False;
|
FTextChangedByRealSetText := False;
|
||||||
|
|
||||||
if (FEmulatedTextHintStatus=thsHidden) and CanShowEmulatedTextHint then
|
if (FEmulatedTextHintStatus=thsHidden) and CanShowEmulatedTextHint then
|
||||||
|
Loading…
Reference in New Issue
Block a user