Selection bounds and Unicode text

General TRichView support forum. Please post your questions here
Post Reply
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Selection bounds and Unicode text

Post by martindholmes »

Hi there,

I'm trying to implement a "Find All" function which creates a list of all the hits from a particular search operation, using SearchTextW. I'm able to find each instance of the search text without problems, but I'm having trouble storing information about the hit (start location, length, and a "hit in context" string that I generate with GetTextRange). The obvious way to do this is to use RVLinear functions, but they all work with strings, not WideStrings. So I have a couple of questions:

1. Is there any plan to provide a WideString version of RVLinear.pas? I see you've created RVGetTextW.pas already; a version of RVLinearW.pas would be really handy.

2. If not, is there any way to store the details of the search hit? My problem here is that the document may contain tables, so I not only need to know the item number and offset, but also the RVData that contains the item.

3. Is there a simpler way to do this?

All help appreciated,
Martin
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, but if you create a list of SearchTextW results, I think you know what text is found.
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Post by martindholmes »

I know what text was found, but I don't know where it was found (in what RVData).

I suppose I'll have to create a linear list of all the items in all the RVDatas, and do the search inside each item.

Cheers,
Martin
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can use RVGetSelection and RVSetSelection from RVLinear.pas to store/restore the selection. They work if document has Unicode text.
Post Reply