An idea for footnote-handling: will this work?

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

An idea for footnote-handling: will this work?

Post by martindholmes »

Hi there,

In my eternal quest to find a good way to handle footnotes in TRichViewEdit, I have an idea I'd like to run by you:

Do you think it would be practical to store formatted text, created in a separate TRichViewEdit control, in the PChar strings associated with an item in another TRichViewEdit? Here's what I imagine:

In the main edit control, the user inserts a footnote. In another TRichViewEdit which pops up, the user then writes and formats the footnote text. Then I stream out this text in RVF to a string stream, and store the string as a PChar tag (rvoTagsArePChars) in the main TRichViewEdit. When I need to show the comment again, I stream out the contents of the tag into the footnote editing control.

Does this sound like a practical approach? I'm working with Unicode text.

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

Post by Sergey Tkachenko »

I think it's better to store some unique footnote identifier in tag, and maintain a database of footnotes (two fields: identifier and formatted text)
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Post by martindholmes »

Hi there,

I'm interested to know why you think so. If I store the data in the PChar tag, I only have to store one set of data, and I don't have to track identifiers externally. If I use an identifier and a separate data structure, there's more work to do, and I risk the two getting out of sync.

Is there any technical objection to storing RVF in a PChar tag?

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

Post by Sergey Tkachenko »

RVF may contain line breaks and #0 characters, they are not allowed in tag strings.
Well, storing RVF in tags is actually more simple, but you need to encode it somehow to eliminate these characters.
Post Reply