Ignore:
Timestamp:
Apr 30, 2007, 9:01:02 PM (18 years ago)
Author:
RBRi
Message:

more refactoring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NewView/HelpFile.pas

    r124 r140  
    157157  BseErr,
    158158  StringUtilsUnit,
     159  CharUtilsUnit,
    159160  DebugUnit,
    160   ACLStringUtility,
    161161  ACLFileIOUtility,
    162162  ACLLanguageUnit;
     
    964964  i: longint;
    965965  pFontSpec: pTHelpFontSpec;
     966  tmpSubstitutionItems : TStringList;
     967  tmpCounter : integer;
     968  tmpDimensionParts : TStringList;
    966969begin
    967970  ParseFontTable; // (re)load table from raw data
    968971
    969   while Substitutions <> '' do
    970   begin
    971     Item := ExtractNextValue( Substitutions, ';' );
     972  tmpSubstitutionItems := TStringList.Create;
     973  StrExtractStrings(tmpSubstitutionItems, Substitutions, [';'], #0);
     974
     975  for tmpCounter := 0 to tmpSubstitutionItems.Count - 1 do
     976  begin
     977    Item := tmpSubstitutionItems[tmpCounter];
    972978    try
    973979      if Item <> '' then
     
    975981        // Look for space in xxxx WxH
    976982
    977         SpacePos := FindCharFromEnd( Item, ' ' );
     983        SpacePos := LastPosOfChar(' ', Item);
    978984        if SpacePos > 0 then
    979985        begin
     
    981987          FontName := StrLeft( Item, SpacePos - 1 );
    982988          Delete( Item, 1, SpacePos );
     989
    983990          // width and height after, with an X between
    984           W := StrToInt( ExtractNextValue( Item, 'x' ) );
    985           H := StrToInt( Item );
     991          tmpDimensionParts := TStringList.Create;
     992          StrExtractStrings(tmpDimensionParts, Item, ['x'], #0);
     993          W := StrToInt(tmpDimensionParts[0]);
     994          H := StrToInt(tmpDimensionParts[1]);
     995          tmpDimensionParts.Destroy;
    986996          if ( W > 0 ) and ( H > 0 ) then
    987997          begin
     
    9901000            begin
    9911001              pFontSpec := _FontTable[ i ];
    992               if StrNPas( pFontSpec ^. FaceName,
    993                           sizeof( pFontSpec ^. FaceName ) ) = FontName then
     1002              if StrPasWithLength( pFontSpec^.FaceName, sizeof( pFontSpec^.FaceName ) ) = FontName then
    9941003              begin
    9951004                // same face name...
     
    10071016    end;
    10081017  end;
     1018
     1019  tmpSubstitutionItems.Destroy;
    10091020end;
    10101021
     
    10261037  Result := '';
    10271038
    1028   if    StringsSame( Ext, '.inf' )
    1029      or StringsSame( Ext, '.hlp' ) then
     1039  if    StrEqualIgnoringCase( Ext, '.inf' )
     1040     or StrEqualIgnoringCase( Ext, '.hlp' ) then
    10301041  begin
    10311042    szName := Filename;
Note: See TracChangeset for help on using the changeset viewer.