View Issue Details

IDProjectCategoryView StatusLast Update
0006411JEDI VCL00 JVCL Componentspublic2015-09-14 11:24
ReporterhusteAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status feedbackResolutionopen 
Product VersionDaily / GIT 
Target VersionFixed in Version 
Summary0006411: JvRichEdit.FindText() does not work properly with stBackward turned on
DescriptionLet StartPos be the current SelStart:
According to the documentation of JvRichEdit, this should work to find a given Text backwards:
  FindText(SprungMarke,0,StartPos-1,[stBackward,stSetSelection]);

In fact, the EM_FINDTEXTEX message used in FindText works differently: cpMin and cpMax are reversed. See remarks on https://msdn.microsoft.com/en-us/library/windows/desktop/bb788011%28v=vs.85%29.aspx

Thus, I changed the code in FindText in my local installation to:
[...]
  with Find.chrg do
  begin
    if stBackward in Options then
      begin
      cpMax := StartPos;
      cpMin := cpMax + Abs(Length);
      end
    else
      begin
      cpMin := StartPos;
      cpMax := cpMin + Abs(Length);
      end;
  end;
  if RichEditVersion >= 2 then
[...]

TagsNo tags attached.

Activities

obones

2015-09-14 11:24

administrator   ~0021191

Please provide the zipped sources of a sample application showing this

Issue History

Date Modified Username Field Change
2015-06-01 13:25 huste New Issue
2015-09-14 11:24 obones Note Added: 0021191
2015-09-14 11:24 obones Status new => feedback