ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/_old_/Code/OniDataClass.pas
(Generate patch)

Comparing oup/current/Code/OniDataClass.pas (file contents):
Revision 51 by alloc, Sat Dec 23 22:16:42 2006 UTC vs.
Revision 56 by alloc, Mon Dec 25 18:36:41 2006 UTC

# Line 411 | Line 411 | begin
411      end;
412    end;
413    SetLength(Result, list.Count);
414 <  fields := TStringList.Create;
415 <  if sort in [stIDAsc, stNameAsc, stExtAsc] then
416 <    for i := 0 to list.Count - 1 do
417 <    begin
418 <      getfields;
419 <      Result[i] := id + '-' + name + '.' + extension;
420 <    end
421 <  else
422 <    for i := list.Count - 1 downto 0 do
423 <    begin
424 <      getfields;
425 <      Result[list.Count - i - 1] := id + '-' + name + '.' + extension;
426 <    end;
414 >  if Length(Result) > 0 then
415 >  begin
416 >    fields := TStringList.Create;
417 >    if sort in [stIDAsc, stNameAsc, stExtAsc] then
418 >      for i := 0 to list.Count - 1 do
419 >      begin
420 >        getfields;
421 >        Result[i] := id + '-' + name + '.' + extension;
422 >      end
423 >    else
424 >      for i := list.Count - 1 downto 0 do
425 >      begin
426 >        getfields;
427 >        Result[list.Count - i - 1] := id + '-' + name + '.' + extension;
428 >      end;
429 >    fields.Free;
430 >  end;
431    list.Free;
428  fields.Free;
432   end;
433  
434  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)