lcl: don't add lineending after the last line in TListBox.GetSelectedText (bug #0012839)

git-svn-id: trunk@18097 -
This commit is contained in:
paul 2009-01-04 09:33:40 +00:00
parent 342531bc74
commit 93a355923e

View File

@ -670,10 +670,15 @@ function TCustomListBox.GetSelectedText: string;
var
i: Integer;
begin
Result:='';
if ItemIndex<0 then exit;
for i:=0 to Items.Count-1 do
if Selected[i] then Result:=Result+Items[i]+LineEnding;
Result := '';
if ItemIndex < 0 then
Exit;
for i := 0 to Items.Count - 1 do
if Selected[i] then
if Result = '' then
Result := Items[i]
else
Result := Result + LineEnding + Items[i]
end;
{------------------------------------------------------------------------------