Ignore:
Timestamp:
Mar 9, 2021, 9:19:49 AM (4 years ago)
Author:
chronos
Message:
  • Modified: Synced code with current trunk version.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Packages/CevoComponents/StringTables.pas

    r210 r303  
    1919    function GetHandle(const Item: string): integer;
    2020    function LookupByHandle(Handle: integer; Index: integer = -1): string;
    21     function Lookup(const Item: string; Index: integer = -1): string;
     21    function Lookup(const Item: string; Index: Integer = -1): string;
    2222    function Search(const Content: string; var Handle, Index: integer): boolean;
    2323  end;
     24
    2425
    2526implementation
     
    7071  s: string;
    7172begin
    72   if Index < 0 then
     73  if Index < 0 then begin
    7374    if Handle < 0 then begin
    7475      Result := '';
     
    8687      end;
    8788      Result := S;
    88     end else
    89     if (Handle + Index + 1) >= Lines.Count then begin
    90       Result := '';
    91       Exit;
    92     end else Result := Lines[Handle + Index + 1];
     89    end;
     90  end else
     91  if (Handle + Index + 1) >= Lines.Count then begin
     92    Result := '';
     93    Exit;
     94  end else Result := Lines[Handle + Index + 1];
    9395  while (Result <> '') and ((Result[1] = ' ') or (Result[1] = #9)) do
    9496    Delete(Result, 1, 1);
     
    99101end;
    100102
    101 function TStringTable.Lookup(const Item: string; Index: integer): string;
     103function TStringTable.Lookup(const Item: string; Index: Integer): string;
    102104var
    103   Handle: integer;
     105  Handle: Integer;
    104106begin
    105107  Handle := GetHandle(Item);
    106   if Handle >= 0 then
    107     result := LookupByHandle(Handle, Index)
    108   else
    109     result := '';
    110   if result = '' then
    111     if Index < 0 then
    112       result := Format('[%s]', [Item])
    113     else
    114       result := Format('[%s %d]', [Item, Index])
     108  if Handle >= 0 then Result := LookupByHandle(Handle, Index)
     109    else Result := '';
     110  if Result = '' then begin
     111    if Index < 0 then Result := Format('[%s]', [Item])
     112      else Result := Format('[%s %d]', [Item, Index]);
     113  end;
    115114end;
    116115
     
    153152    begin
    154153      result := false;
    155       exit
     154      exit;
    156155    end;
    157156    if Copy(Lines[h + i + 1], 1, 1) = '#' then
    158157    begin
    159158      h := h + i + 1;
    160       i := -1
     159      i := -1;
    161160    end;
    162161    if (h >= 0) and not ((Length(Lines[h + i + 1]) > 0) and (Lines[h + i + 1][1] in ['#', ':', ';'])) and
Note: See TracChangeset for help on using the changeset viewer.