Commit e736011c authored by Michael Van Canneyt's avatar Michael Van Canneyt
Browse files

* Fix from Bart for issue #39938

parent f8848dd1
Pipeline #657744200 passed with stages
in 18 minutes and 24 seconds
......@@ -780,31 +780,34 @@ function TMaskUtils.ApplyMaskToText(AValue: String): String;
end//FMaskSave = True
else
begin//FMaskSave = False
if FTrimType = metTrimRight then
if Value<>'' then
begin
//fill text from left to rigth, skipping MaskLiterals
j := 1;
for i := 1 to FMaskLength do
if FTrimType = metTrimRight then
begin
if not IsLiteral(FMask[i]) then
//fill text from left to rigth, skipping MaskLiterals
j := 1;
for i := 1 to FMaskLength do
begin
if (AValue[j] = #32) then S[i]:= FSpaceChar else S[i] := AValue[j];
Inc(j);
if j > Length(AValue) then Break;
if not IsLiteral(FMask[i]) then
begin
if (AValue[j] = #32) then S[i]:= FSpaceChar else S[i] := AValue[j];
Inc(j);
if j > Length(AValue) then Break;
end;
end;
end;
end
else
begin
//fill text from right to left, skipping MaskLiterals
j := Length(AValue);
for i := FMaskLength downto 1 do
end
else
begin
if not IsLiteral(FMask[i]) then
//fill text from right to left, skipping MaskLiterals
j := Length(AValue);
for i := FMaskLength downto 1 do
begin
if (AValue[j] = #32) then S[i] := FSpaceChar else S[i] := AValue[j];
Dec(j);
if j < 1 then Break;
if not IsLiteral(FMask[i]) then
begin
if (AValue[j] = #32) then S[i] := FSpaceChar else S[i] := AValue[j];
Dec(j);
if j < 1 then Break;
end;
end;
end;
end;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment