Changeset 56 for oup/current/Code


Ignore:
Timestamp:
Dec 25, 2006, 7:36:41 PM (18 years ago)
Author:
alloc
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • oup/current/Code/OniDataClass.pas

    r51 r56  
    412412  end;
    413413  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;
    427431  list.Free;
    428   fields.Free;
    429432end;
    430433
Note: See TracChangeset for help on using the changeset viewer.