Michael,
It took me a few minutes, but I figured out what you were doing with that first fix. I've implemented something similar in my own code now. That fixes an obscure bug I've heard from users occassionally. Good catch!
I never noticed the second bug because of how I use the procedure.
I'll see about updating the code in my original post with the first fix.
Thanks!
-David
Search conception in TRichView
-
- Posts: 42
- Joined: Wed Feb 28, 2007 4:14 am
Yeah, I've used this method in very specific way. The key trouble of this code inDavidRM wrote:I never noticed the second bug because of how I use the procedure.
Code: Select all
startItemNo:=rv.RVData.GetFirstItemVisible;
It's a big trouble, then we're making the search from the cycle (for example, to mark all entries of text). What will happen, if we implement this procedure?
As you see, this part gonna be implemented, if stufFromStart isn't set. But the trouble is that StartItemNo will be the first visible item in RV. This means that actually it gonna always find the similiar first item of the text, not the sequence. If we should implement smth like this
Code: Select all
while SearchTextUnicode(Self, ReplaceInfo.TextToSearch, ConvertSearchInfo(ReplaceInfo) - [stufFromStart]) do
begin
{do smth}
end;
Anyway, the contributed code is great, thanks a lot
- Michael