mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-06 19:38:24 +02:00
LCL, Translations unit: Improved lieending removal code clarity, added more comments.
git-svn-id: trunk@52700 -
This commit is contained in:
parent
96b2691e94
commit
3bb3ac5dff
@ -1168,14 +1168,18 @@ begin
|
|||||||
end else
|
end else
|
||||||
Result:=OriginalValue;
|
Result:=OriginalValue;
|
||||||
//Remove lineending at the end of the string if present.
|
//Remove lineending at the end of the string if present.
|
||||||
//This is the case e.g. for multiline string and not desired when assigning e.g. to
|
//This is the case e.g. for multiline strings and not desired when assigning e.g. to
|
||||||
//Caption property (can negatively affect form layout). In other cases it should not matter.
|
//Caption property (can negatively affect form layout). In other cases it should not matter.
|
||||||
l:=Length(Result);
|
l:=Length(Result);
|
||||||
if l>1 then
|
if l>1 then
|
||||||
begin
|
begin
|
||||||
|
//Every string with #13 and/or #10 character at the end was treated as multiline, this means that
|
||||||
|
//extra lineending could have been added to it.
|
||||||
if RightStr(Result,2)=#13#10 then
|
if RightStr(Result,2)=#13#10 then
|
||||||
|
begin
|
||||||
if l>2 then //do not leave the string empty
|
if l>2 then //do not leave the string empty
|
||||||
SetLength(Result,l-2)
|
SetLength(Result,l-2);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
if (Result[l]=#13) or (Result[l]=#10) then
|
if (Result[l]=#13) or (Result[l]=#10) then
|
||||||
SetLength(Result,l-1);
|
SetLength(Result,l-1);
|
||||||
|
Loading…
Reference in New Issue
Block a user