View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002513 | JEDI VCL | 00 JVCL Components | public | 2005-01-16 07:50 | 2005-08-10 08:14 |
Reporter | Simes | Assigned To | obones | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.00 BETA 2 | ||||
Target Version | Fixed in Version | 3.10 | |||
Summary | 0002513: TJvFindReplace frWholeWord or frMatchCase prevents valid matches from being found. | ||||
Description | Run code below. Press Test, then Find or Replace One. It reports text not found, yet it's clearly present. Procedure DoOnFind is at fault. The section if FoundPos.StartAt > -1 then begin if (frWholeWord in TFindDialog(Sender).Options) and not FoundPos.isWhole then DoFailed(Sender) else if (frMatchCase in TFindDialog(Sender).Options) and not FoundPos.isSameCase then DoFailed(Sender) causes a failure to be reported if found instance doen't match case or whole word option, but instead, it should re-search looking for an instance that does match the required whole word/case option. (I'm beginning to think this component may not have been thoroughly tested.) | ||||
Additional Information | unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, JvComponent, JvFindReplace; type TForm1 = class(TForm) JvFindReplace1: TJvFindReplace; Memo1: TMemo; Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure FormShow(Sender: TObject); private public end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormShow(Sender: TObject); begin Button1.Caption := 'Reset'; Button2.Caption := 'Test'; Button1Click(self); end; procedure TForm1.Button1Click(Sender: TObject); begin Memo1.Clear; Memo1.Lines.Add('unit MAINtain frm;'); Memo1.Lines.Add('main this main that maintain main'); Memo1.Lines.Add('a main b'); Memo1.CaretPos := Point(0, 0); Memo1.SetFocus; end; procedure TForm1.Button2Click(Sender: TObject); begin JvFindReplace1.Options := [frDown, frWholeWord, frMatchCase]; JvFindReplace1.EditControl := Memo1; JvFindReplace1.FindText := 'main'; JvFindReplace1.ReplaceText := 'abcd'; JvFindReplace1.Replace; end; end. | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2005-01-16 07:50 | Simes | New Issue | |
2005-01-16 13:06 | Simes | Note Added: 0006161 | |
2005-01-17 03:16 | obones | Relationship added | related to 0002515 |
2005-08-10 08:14 | obones | Status | new => resolved |
2005-08-10 08:14 | obones | Resolution | open => fixed |
2005-08-10 08:14 | obones | Assigned To | => obones |