Ignore:
Timestamp:
May 9, 2015, 2:00:05 PM (10 years ago)
Author:
healthsevak
Message:

fixed the bug related to extra spaces being introduced at the start of line after "Change" action

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/HealthSevak-CPRS/CPRS-Lib/Hans SpellCheck/skaSpellCheck.pas

    r1694 r1712  
    8989    function GetAboutThis: String;
    9090    procedure SaveForUndo(const Ignoring: Boolean=False);
     91    procedure ShowBtnClose(const ShowIt: Boolean = True);
    9192  public
    9293    constructor Create(AOwner: TComponent); overload; override;
     
    159160function TskaHunSpellChecker.AbortSpellCheck(Verbose: Boolean = True): Boolean;
    160161begin
     162  if FStatus <> ssChecking then
     163  begin
     164    FStatus := ssCancelled;
     165    Close;
     166    exit;
     167  end;
     168
    161169  Result := (not isModified)  or
    162170            (not Verbose) or (MessageDlg(ConfirmAbort, mtConfirmation,
     
    165173  if Result then
    166174    FStatus := ssCancelled;
     175
     176  ShowBtnClose;
    167177end;
    168178
     
    211221begin
    212222  full := SourceTextControl.Lines[CurrentLine];
    213   prefix := copy(CurrentText, 1, WordPos-1);
     223  prefix := copy(CurrentText, 2, WordPos-2);    //remember there is one extra space at the start of the line prefixed while populating this variable
    214224  Suffix :=  copy(CurrentText, WordPos+WordLength,
    215225                           length(CurrentText));
     
    228238  Initialize;
    229239  WaitForUser := False;
     240  FStatus := ssChecking;
    230241  SourceTextControl.Invalidate;
    231242  Result := not WaitForUser;
     
    251262 SourceTextControl.Invalidate;
    252263 //SourceTextControl.Invalidate;
     264 ShowBtnClose(False);
    253265end;
    254266
     
    403415    uHunSpellLib.hunspell_suggest_free(FpointerHunLib, suggestions, Count);
    404416  end;
     417end;
     418
     419procedure TskaHunSpellChecker.ShowBtnClose(const ShowIt: Boolean);
     420begin
     421  if Assigned(btnClose) then
     422  begin
     423   btnClose.Enabled := ShowIt;
     424   btnClose.Visible := ShowIt;
     425   if ShowIt then
     426   begin
     427     btnClose.BringToFront;
     428     btnClose.SetFocus;
     429   end;
     430  end;
    405431end;
    406432
     
    508534    begin
    509535      FStatus := ssCompleted;
    510       if Assigned(btnClose) then
    511         btnClose.Click;
     536      if ShowCompletionMessage then
     537        ShowMessage(CompletionMessage);
     538      ShowBtnClose;
    512539    end;
    513540    {$R+}
Note: See TracChangeset for help on using the changeset viewer.