Ignore:
Timestamp:
Sep 21, 2007, 5:57:18 PM (18 years ago)
Author:
RBRi
Message:

fix for #33
fix usage of StrStartsWithIgnoringCase

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NewView/MainForm.pas

    r236 r252  
    23842384  Filename := THelpFile( CurrentOpenFiles[ 0 ] ).Filename;
    23852385  NamePart := ExtractFileName( Filename );
    2386   Result := StrStartsWithIgnoringCase('newview', NamePart);
     2386  Result := StrStartsWithIgnoringCase(NamePart, 'newview');
    23872387end;
    23882388
     
    44874487End;
    44884488
    4489 Procedure TMainForm.IndexSearchEditOnScan (Sender: TObject;
    4490   Var KeyCode: TKeyCode);
     4489Procedure TMainForm.IndexSearchEditOnScan (Sender: TObject; Var KeyCode: TKeyCode);
    44914490Begin
    44924491  case KeyCode of
     
    45154514Procedure TMainForm.IndexSearchEditOnChange (Sender: TObject);
    45164515var
    4517   MatchIndex: longint;
    4518   IndexINdex: longint;
    4519   SearchText: string;
     4516  tmpMatchIndex : longint;
     4517  tmpSearchText: string;
     4518  i : longint;
    45204519Begin
    45214520  if InIndexSearch then
    45224521    exit;
    45234522
    4524   MatchIndex:= -1;
    4525   SearchText:= trim( IndexSearchEdit.Text );
    4526   for IndexIndex:= 0 to DisplayedIndex.Count - 1 do
    4527   begin
    4528     if StrStartsWithIgnoringCase( SearchText, DisplayedIndex[ IndexIndex ] ) then //IndexEntry ) then
     4523  tmpMatchIndex := -1;
     4524  tmpSearchText := trim(IndexSearchEdit.Text);
     4525
     4526  for i := 0 to DisplayedIndex.Count - 1 do
     4527  begin
     4528    if StrStartsWithIgnoringCase(DisplayedIndex[i], tmpSearchText) then
    45294529    begin
    4530       MatchIndex:= IndexIndex;
     4530      tmpMatchIndex := i;
    45314531      break;
    45324532    end;
    45334533  end;
    45344534
    4535   if MatchIndex = -1 then
     4535  if tmpMatchIndex = -1 then
    45364536    exit;
    45374537
    45384538  InIndexSearch:= true;
    45394539
    4540   if IndexListBox.ItemIndex <> MatchIndex then
    4541     IndexListBox.ItemIndex:= MatchIndex;
     4540  if IndexListBox.ItemIndex <> tmpMatchIndex then
     4541    IndexListBox.ItemIndex:= tmpMatchIndex;
    45424542
    45434543  InIndexSearch:= false;
Note: See TracChangeset for help on using the changeset viewer.