RVFSaveToStream problem

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

RVFSaveToStream problem

Post by martindholmes »

Hi Sergey,

I'm having a very strange problem with a TRichViewEdit control. I load small documents into it from streams, and save them out to streams. Here's the problem:

I load one of these documents, with colours and formatting, and it loads fine. Then I make a text style change (say I add underlining to a word). Then I save the document to stream. When I reload it from the stream, the underlining is gone. However, if I do the same thing again (make the same text underlined), save to stream, and reload again, this time the underlining persists.

I've been trying to figure this problem out for days, and I just can't find the source of the problem. Do you have any idea what might cause this?

I'm still using version 10.3, but I don't see anything in the changelog for 11 which would relate to this. These are the relevant properties of the TRichViewEdit:

Options = [rvoAllowSelection, rvoScrollToEnd, rvoShowPageBreaks, rvoTagsArePChars, rvoAutoCopyText, rvoAutoCopyUnicodeText, rvoAutoCopyRVF, rvoAutoCopyImage, rvoAutoCopyRTF, rvoFormatInvalidate, rvoDblClickSelectsWord, rvoRClickDeselects, rvoFastFormatting]

RVFOptions = [rvfoIgnoreUnknownCtrls, rvfoConvUnknownStylesToZero, rvfoUseStyleNames, rvfoSaveBack, rvfoLoadBack, rvfoSaveTextStyles, rvfoSaveParaStyles, rvfoSaveLayout, rvfoLoadLayout, rvfoSaveDocProperties, rvfoLoadDocProperties]

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

Post by Sergey Tkachenko »

Exclude rvfoUseStyleNames.
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Post by martindholmes »

That did it! But I'm not sure why.

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

Post by Sergey Tkachenko »

When this option is included, names of styles are saved in RVF files instead of indices. It works correctly only if all styles have unique names (and makes sense when collections of styles are not saved in documents)
Post Reply