Page 1 of 1

Sharing styles between RichViewEdit, RVHEader and RVFooter

Posted: Wed Jul 25, 2012 9:20 am
by vit
Hi!

I use the same TRVStyle for RichViewEdit, RVHEader and RVFooter of TSRichViewEdit (ExternalRVStyle, ExternalRVStyleHeader and ExternalRVStyleFooter).

If style A is only used by RVHEader and style B by RVFooter, TSRichViewEdit.RichViewEdit.DeleteUnusedStyles will delete all them. Is there way to change this behaviour? I need to every editor of TSRichViewEdit take into account which styles uses other editors.

Posted: Wed Jul 25, 2012 11:36 am
by Sergey Tkachenko
In the current version, RichViewEdit, RVHeader and RVFooter must be linked to different RVStyles. Otherwise they work incorrectly.

Posted: Fri Aug 30, 2013 4:23 pm
by JonRobertson
What are some problems this could cause? Is it just management functions like DeleteUnusedStyles that are problematic? Or perhaps document editing via the visual component versus method calls?

If I have the styles set before document generation, never alter the styles during document generation, generate all document content via code, then save the RVF to stream, will there be problems?

I'm curious because I've always used the same style component generating RVF documents with headers and footers. I'll have to triple the number of style components I'm using across the entire project, and each of the new ones will simply be a duplicate of the existing ones. :(

Posted: Fri Aug 30, 2013 6:24 pm
by Sergey Tkachenko
Well, I think DeleteUnusedStyles is the main problem.
Additionally, when reading RVF, when reading header/footer, styles are replaced. But since styles saved for header/footer will be the same as the main document, it should not be a problem.
Also, if StyleTemplates are used, styles are cleared before reading header/footer. This is a critical problem, because they cannot be restored. But it happens only if UseStyleTemplates=True.

Well, all these problems could be solved on the component level, I just do not think that this problem is too important.

Posted: Fri Aug 30, 2013 6:44 pm
by JonRobertson
In general should a TRVStyle component only be used by a single source of RVF content?

Posted: Sat Aug 31, 2013 10:52 am
by Sergey Tkachenko
Yes.
A single RVStyle for multiple RichView may be useful if you use a fixed set of styles (for example, displaying messages in UI)