trichview.com

trichview.support




Re: Bug in RichView - merging styles of newly inserted rvf documents.


Return to index


Author

Message

Sergey Tkachenko

Posted: 04/29/2003 9:49:48


It's not important if you use LoadRVF or InsertRVFFromStream, they call the

same function inside.


When you call richview1.InsertRVFFromStream, mappings are cleared in

DoneStyleMapping

When you call table1.Cells[0, 0].InsertRVFFromStream, mappings are not

cleared. Cells cannot clear mappings because they do not belong to cell,

they belong to the main RichView.

PTextStylesMapping is a local variable, but  PTextStylesMapping^ is a

mapping belonging to the main RichView.


You just cannot use "merge" mode for styles when inserting RVF in cell.

Workaround is in my previous posting.


> Freeing the PRVIntegerList variables in TCustomRVData.DoneStyleMapping

still

> seems to be the correct solution to this problem. After searching all the

> RichView units, I can find no other location (outside of

> InsertRVFFromStream's scope) where the PRVIntegerList's pointed to by

> PTextStylesMapping^, PParaStylesMapping^, and PListStylesMapping^ are

> referenced. If this is not correct, please clarify where else these values

> are used and how else I can correct this problem. I have reviewed the

> MailMerge2 project and it doesn't address the issue I've described.


They are freed in TRichViewRVData's (RVRVData.pas) implementation of

DoneStyleMapping.

TRichViewRVData contains fields where these pointers point to:

RVFTextStylesMapping, RVFParaStylesMapping, RVFListStyleMapping:

TRVIntegerList;


Imagine loading RVF document containing table in "style merge" mode.

First, styles from RVF are loaded and style mappings are initialized.

Next, the first cell is loaded (using these style mappings). Assume that

this cell freed style mappings.

The next cell is loaded. But the style mappings are nil, and this cell is

loaded in "ignore styles" mode. The same for rest of the document.






Powered by ABC Amber Outlook Express Converter