Changeset 325
- Timestamp:
- Aug 16, 2008, 6:07:02 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.19_branch/NewView/HelpFile.pas
r307 r325 373 373 pEntry: pTTOCEntryStart; 374 374 pEnd: pTTOCEntryStart; 375 tmpSizeAsLongword : longword; 375 376 begin 376 377 LogEvent(LogParse, 'Read contents'); 377 378 378 379 if _pHeader^.ntoc = 0 then 380 begin 379 381 exit; // explicit check required since ntoc is unsigned 382 end; 380 383 381 384 // Presize the topics list to save reallocation time 382 385 _Topics.Capacity := _pHeader^.ntoc; 386 387 // this has to be used because we multiply a longword with 388 // this; otherwise the compiler generates code that 389 // calculates the wrong value 390 tmpSizeAsLongword := sizeof(uint32); 383 391 384 392 // read slots first so that Topics can refer to it. 385 393 ReadFileBlock( _pSlotOffsets, 386 394 _pHeader^.slotsstart, 387 _pHeader^.nslots * sizeof( uint32 ));395 _pHeader^.nslots * tmpSizeAsLongword); 388 396 389 397 ReadFileBlock( _pContentsData, … … 496 504 begin 497 505 if p >= pEnd then 506 begin 498 507 // ran off end of data 499 508 raise EHelpFileException.Create( ErrorCorruptHelpFile ); 509 end; 500 510 501 511 pEntryHeader := p; … … 505 515 GetMemString( p, EntryText, IndexTitleLen ); 506 516 if ( pEntryHeader^.flags and 2 ) > 0 then 517 begin 507 518 EntryText := '- ' + EntryText; 519 end; 508 520 if pEntryHeader^.TOCIndex < _Topics.Count then 509 521 _Index.AddObject( EntryText, _Topics[ pEntryHeader^.TOCIndex ] )
Note:
See TracChangeset
for help on using the changeset viewer.