Changeset 333 for branches/2.19_branch/NewView/HelpTopic.pas
- Timestamp:
- Aug 31, 2008, 2:01:55 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.19_branch/NewView/HelpTopic.pas
r290 r333 1460 1460 ): longint; 1461 1461 var 1462 WordSequence: TList;1463 SequenceStepIndex: longint;1462 tmpWordSequence: TList; 1463 tmpSequenceStepIndex: longint; 1464 1464 pSequenceStepWords: Uint32ArrayPointer; 1465 1465 … … 1476 1476 for SequenceIndex := 0 to WordSequences.Count - 1 do 1477 1477 begin 1478 WordSequence := WordSequences[ SequenceIndex ];1479 pSequenceStepWords := WordSequence[ 0 ];1478 tmpWordSequence := WordSequences[ SequenceIndex ]; 1479 pSequenceStepWords := tmpWordSequence[ 0 ]; 1480 1480 1481 1481 if pSequenceStepWords^[ GlobalDictIndex ] > 0 then 1482 1482 begin 1483 1483 // matched first step in this sequence. Look ahead... 1484 1485 SequenceStepIndex := 0; 1484 tmpSequenceStepIndex := 1; 1486 1485 1487 1486 pDataTemp := pData; 1488 1487 SlotIndexTemp := SlotIndex; 1489 1488 StateTemp := State; 1489 1490 1490 while true do 1491 1491 begin 1492 inc( SequenceStepIndex ); 1493 if SequenceStepIndex = WordSequence.Count then 1494 begin 1495 // have a match for the sequence, insert start highlight 1496 Result := WordSequence.Count; 1492 if tmpSequenceStepIndex = tmpWordSequence.Count then 1493 begin 1494 // have a match for the sequence; time to leave 1495 Result := tmpWordSequence.Count; 1497 1496 break; 1498 1497 end; 1499 1498 1500 1499 // get words for next step in sequence 1501 pSequenceStepWords := WordSequence[ SequenceStepIndex ]; 1502 1503 DictIndex := GetNextIPFTextItem( SlotIndexTemp, 1504 pDataTemp, 1505 StateTemp ); 1500 pSequenceStepWords := tmpWordSequence[ tmpSequenceStepIndex ]; 1501 1502 DictIndex := GetNextIPFTextItem( SlotIndexTemp, pDataTemp, StateTemp ); 1506 1503 if DictIndex = -2 then 1507 1504 begin … … 1518 1515 1519 1516 // s := pstring( _GlobalDictionary[ DictIndex ] )^; // for debug only 1517 1518 1519 // ignore whitespace 1520 1520 if not StrIsEmptyOrSpaces( pstring( _GlobalDictionary[ DictIndex ] )^ ) then 1521 1521 begin … … 1525 1525 break; 1526 1526 end; 1527 1528 // match; next one 1529 inc(tmpSequenceStepIndex); 1527 1530 end; 1528 1531 … … 1533 1536 end; // for sequenceindex ... 1534 1537 end; 1538 1535 1539 1536 1540 // Main translation function. Turns the IPF data into … … 1637 1641 1638 1642 if ShowWordSeparators then 1643 begin 1639 1644 Text.AddString( '{' + IntToStr( GlobalDictIndex )+ '}' ); 1645 end; 1640 1646 1641 1647 // normal lookup … … 1656 1662 // store string into "word" 1657 1663 if State.TextBlock.Length = 0 then 1664 begin 1658 1665 // store start of block 1659 1666 State.StartOfTextBlock := Text.Length; 1667 end; 1660 1668 1661 1669 State.TextBlock.AddString( StringToAdd ); … … 1672 1680 begin 1673 1681 // now finished, insert end highlight 1674 StringToAdd := StringToAdd 1675 + State.BackgroundColorTag; 1676 1682 StringToAdd := StringToAdd + State.BackgroundColorTag; 1677 1683 end; 1678 1684 end … … 1699 1705 if SequenceStepIndex = 0 then 1700 1706 // and ends it. 1701 StringToAdd := StringToAdd 1702 + State.BackgroundColorTag; 1707 StringToAdd := StringToAdd + State.BackgroundColorTag; 1703 1708 end; 1704 1709 … … 1821 1826 end; 1822 1827 State.TextBlock.Destroy; 1823 1824 end; 1828 end; 1829 1825 1830 1826 1831 function TTopic.SearchForWord( DictIndex: integer;
Note:
See TracChangeset
for help on using the changeset viewer.