Changeset 140
- Timestamp:
- Apr 30, 2007, 9:01:02 PM (18 years ago)
- Location:
- trunk/NewView
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NewView/HelpFile.pas
r124 r140 157 157 BseErr, 158 158 StringUtilsUnit, 159 CharUtilsUnit, 159 160 DebugUnit, 160 ACLStringUtility,161 161 ACLFileIOUtility, 162 162 ACLLanguageUnit; … … 964 964 i: longint; 965 965 pFontSpec: pTHelpFontSpec; 966 tmpSubstitutionItems : TStringList; 967 tmpCounter : integer; 968 tmpDimensionParts : TStringList; 966 969 begin 967 970 ParseFontTable; // (re)load table from raw data 968 971 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]; 972 978 try 973 979 if Item <> '' then … … 975 981 // Look for space in xxxx WxH 976 982 977 SpacePos := FindCharFromEnd( Item, ' ');983 SpacePos := LastPosOfChar(' ', Item); 978 984 if SpacePos > 0 then 979 985 begin … … 981 987 FontName := StrLeft( Item, SpacePos - 1 ); 982 988 Delete( Item, 1, SpacePos ); 989 983 990 // 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; 986 996 if ( W > 0 ) and ( H > 0 ) then 987 997 begin … … 990 1000 begin 991 1001 pFontSpec := _FontTable[ i ]; 992 if StrNPas( pFontSpec ^. FaceName, 993 sizeof( pFontSpec ^. FaceName ) ) = FontName then 1002 if StrPasWithLength( pFontSpec^.FaceName, sizeof( pFontSpec^.FaceName ) ) = FontName then 994 1003 begin 995 1004 // same face name... … … 1007 1016 end; 1008 1017 end; 1018 1019 tmpSubstitutionItems.Destroy; 1009 1020 end; 1010 1021 … … 1026 1037 Result := ''; 1027 1038 1028 if Str ingsSame( Ext, '.inf' )1029 or Str ingsSame( Ext, '.hlp' ) then1039 if StrEqualIgnoringCase( Ext, '.inf' ) 1040 or StrEqualIgnoringCase( Ext, '.hlp' ) then 1030 1041 begin 1031 1042 szName := Filename; -
trunk/NewView/HelpTopic.pas
r127 r140 253 253 NewViewConstantsUnit, 254 254 ACLUtility, 255 ACLStringUtility,256 255 ACLFileIOUtility, 257 256 AStringUtilityUnit, 258 257 ACLLanguageUnit, 259 258 StringUtilsUnit, 259 CharUtilsUnit, 260 260 SettingsUnit; 261 261 … … 565 565 566 566 Write( F, ':artwork name=' ); 567 Write( F, Str Quote( 'img' + IntToStr( ImageIndex ) + '.bmp') );567 Write( F, StrInSingleQuotes('img' + IntToStr(ImageIndex) + '.bmp') ); 568 568 569 569 case BitmapFlags and 7 of … … 826 826 end; 827 827 828 // TODO 828 829 function FullDoubleQuote( const s: string ): string; 829 830 begin 830 Result := DoubleQuote 831 + InsertDuplicateChars( s, 832 DoubleQuote ) 833 + DoubleQuote; 831 Result := StrDoubleQuote 832 + StrEscapeAllCharsBy(s, [], CharDoubleQuote) 833 + StrDoubleQuote; 834 834 end; 835 835 … … 906 906 ProgramFilename: string; 907 907 ProgramInfo : TSerializableStringList; 908 tmpProgramLinkParts : TStringList; 908 909 909 910 OutputString: string; … … 1031 1032 // :link reftype=hd refid=... database=<filename> 1032 1033 ExternalLinkFileIndex := ( pData + 2 )^; 1033 ExternalLinkTopicID := Str NPas( pchar( pData + 4 ), ( pData + 3 )^ );1034 ExternalLinkTopicID := StrPasWithLength( pchar( pData + 4 ), ( pData + 3 )^ ); 1034 1035 OutputString := '<blue><link ' + PARAM_LINK_EXTERNAL + ' ' 1035 1036 + IntToStr( ExternalLinkFileIndex ) … … 1043 1044 begin 1044 1045 CheckForAutoURL( Text, State ); 1045 ProgramLink := StrNPas( pchar( pData + 3 ), EscapeLen - 3 ); 1046 ProgramPath := ExtractNextValue( ProgramLink, ' ' ); 1046 ProgramLink := StrPasWithLength( pchar( pData + 3 ), EscapeLen - 3 ); 1047 1048 tmpProgramLinkParts := TStringList.Create; 1049 StrExtractStrings(tmpProgramLinkParts, ProgramLink, [' '], #0); 1050 ProgramPath := tmpProgramLinkParts[0]; 1051 tmpProgramLinkParts.Destroy; 1052 1047 1053 ProgramFilename := ExtractFilename( ProgramPath ); 1048 if StrStarts( 'netscape', ProgramFilename ) 1049 or StrStarts( 'explore', ProgramFilename ) // web explorer? 1050 or StrStarts( 'mozilla', ProgramFilename ) 1054 1055 if StrStartsWithIgnoringCase(PRGM_EXPLORER, ProgramFilename ) // web explorer? 1056 or StrStartsWithIgnoringCase(PRGM_NETSCAPE, ProgramFilename ) 1057 or StrStartsWithIgnoringCase(PRGM_MOZILLA, ProgramFilename ) 1058 or StrStartsWithIgnoringCase(PRGM_FIREFOX, ProgramFilename ) 1051 1059 then 1052 1060 begin … … 1201 1209 begin 1202 1210 pFontSpec := _FontTable[ FontIndex ]; 1203 FaceName := Str NPas( pFontSpec ^. FaceName,1211 FaceName := StrPasWithLength( pFontSpec ^. FaceName, 1204 1212 sizeof( pFontSpec ^. FaceName ) ); 1205 1213 // arbitrarily and capriciously use specified height * 2/3 … … 1511 1519 1512 1520 // s := pstring( _GlobalDictionary[ DictIndex ] )^; // for debug only 1513 if not IsSpaces( pstring( _GlobalDictionary[ DictIndex ] )^ ) then1521 if not StrIsEmptyOrSpaces( pstring( _GlobalDictionary[ DictIndex ] )^ ) then 1514 1522 begin 1515 1523 if pSequenceStepWords^[ DictIndex ] = 0 then … … 1638 1646 StringToAdd := ''; 1639 1647 1640 if IsSpaces( StringToAdd ) then1648 if StrIsEmptyOrSpaces( StringToAdd ) then 1641 1649 begin 1642 1650 // spaces only... … … 2022 2030 2023 2031 if GlobalDictIndex < _GlobalDictionary.Count then 2024 if not IsSpaces( pstring( _GlobalDictionary[ GlobalDictIndex ] )^ ) then;2032 if not StrIsEmptyOrSpaces( pstring( _GlobalDictionary[ GlobalDictIndex ] )^ ) then; 2025 2033 WordRelevance := pStepWordRelevances[ GlobalDictIndex ]; 2026 2034 … … 2265 2273 ProgramLink: string; 2266 2274 ProgramPath: string; 2275 tmpProgramLinkParts : TStringList; 2267 2276 2268 2277 OutputString: string; … … 2372 2381 begin 2373 2382 ExternalLinkFileIndex := ( pData + 2 )^; 2374 ExternalLinkTopicID := Str NPas( pchar( pData + 4 ), ( pData + 3 )^ );2383 ExternalLinkTopicID := StrPasWithLength( pchar( pData + 4 ), ( pData + 3 )^ ); 2375 2384 Write( F, ':link reftype=hd ' 2376 + ' refid=' + Str Quote( ExternalLinkTopicID )2377 + ' database=' + Str Quote( _ReferencedFiles[ ExternalLinkFileIndex ] )2385 + ' refid=' + StrInSingleQuotes( ExternalLinkTopicID ) 2386 + ' database=' + StrInSingleQuotes( _ReferencedFiles[ ExternalLinkFileIndex ] ) 2378 2387 + '.' ); 2379 2388 … … 2382 2391 ecProgramLink: 2383 2392 begin 2384 ProgramLink := StrNPas( pchar( pData + 3 ), EscapeLen - 3 ); 2385 ProgramPath := ExtractNextValue( ProgramLink, ' ' ); 2393 ProgramLink := StrPasWithLength( pchar( pData + 3 ), EscapeLen - 3 ); 2394 2395 tmpProgramLinkParts := TStringList.Create; 2396 StrExtractStrings(tmpProgramLinkParts, ProgramLink, [' '], #0); 2397 ProgramPath := tmpProgramLinkParts[0]; 2398 tmpProgramLinkParts.Destroy; 2399 2386 2400 Write( F, ':link reftype=launch' 2387 + ' object=' + Str Quote( ProgramPath )2388 + ' data=' + Str Quote( ProgramLink )2401 + ' object=' + StrInSingleQuotes( ProgramPath ) 2402 + ' data=' + StrInSingleQuotes( ProgramLink ) 2389 2403 + '.' ); 2390 2404 end; … … 2506 2520 begin 2507 2521 pFontSpec := _FontTable[ FontIndex ]; 2508 FaceName := Str NPas( pFontSpec ^. FaceName,2522 FaceName := StrPasWithLength( pFontSpec ^. FaceName, 2509 2523 sizeof( pFontSpec ^. FaceName ) ); 2510 2524 Write( F, 2511 ':font facename=' + Str Quote( FaceName )2525 ':font facename=' + StrInSingleQuotes( FaceName ) 2512 2526 + ' size=' + IntToStr( pFontSpec ^. Height ) 2513 2527 + 'x' + IntToStr( pFontSpec ^. Width ) -
trunk/NewView/NewViewConstantsUnit.pas
r127 r140 16 16 PARAM_LINK_EXTERNAL = 'external'; 17 17 18 PRGM_EXPLORER = 'explore'; // web explorer 19 PRGM_NETSCAPE = 'netscape'; 20 PRGM_MOZILLA = 'mozilla'; 21 PRGM_FIREFOX = 'firefox'; 22 23 18 24 Implementation 19 25 -
trunk/NewView/ViewStub.pas
r78 r140 68 68 result := NULLHANDLE; 69 69 70 if aCmdLineParameters.getFileNames = '' then70 if aCmdLineParameters.getFileNames(false) = '' then 71 71 // not loading files; nothing to check 72 72 exit; … … 75 75 tmpFilenames := TStringList.Create; 76 76 77 StrExtractStrings(tmpFileItems, aCmdLineParameters.getFileNames , ['+'], #0);77 StrExtractStrings(tmpFileItems, aCmdLineParameters.getFileNames(false), ['+'], #0); 78 78 TranslateIPFEnvironmentVars(tmpFileItems, tmpFileNames ); 79 79
Note:
See TracChangeset
for help on using the changeset viewer.