Adding New Fonts To Table Storage

General TRichView support forum. Please post your questions here
Post Reply
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

Adding New Fonts To Table Storage

Post by DickBryant »

I'm using a TRVEdit to make edits to information that is loaded and stored back into a TRVTableCell in a table in a different TRVEdit. The TRVStyle of the both TRVEdits is set to the same TRVStyle and the TRVEdits are set to AllowAddingStyles dynamically.

My problem is that I can only seem to add new fonts 'one at a time'. If I do that then the new font is stored back into the TRVTableCell properly. If I try to add MORE than one font during an editing session, all the information after the location of the second font change is not stored back into the TRVTable cell. Here's the code I'm using to store the information back into the TRVTableCell:

QMemo is the "Editor" TRVEdit and MasterRVTable.Cells[QNumber-1,1] is the TRVTableCell where the data is being stored.

QMemo.SaveRVFToStream(Stream, False);
Stream.Position := 0;
MasterRVTable.Cells[QNumber-1,1].Clear;
MasterRVTable.Cells[QNumber-1,1].Format(False);
MasterRVTable.Cells[QNumber-1,1].InsertRVFFromStream(Stream, 0, Dummy1, Dummy2, Dummy3, False);
MasterRVTable.Cells[QNumber-1,1].Format(False);
finally
Stream.Clear;
end;

What am I missing here?

Thanks in advance for your help!
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Currently, cells do not support loading RVF with styles.
Workaround:
Create a hiddent TRichView linked to the same RVStyle as richview with table. Load RVF in it. Exclude [rvfoSaveTextStyles, rvfoSaveParaStyles] from RVFOptions of this hidden RichView. Save RVF from this RichView to stream. Load it in cell.
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

Post by DickBryant »

Hi Sergey,

OK, that does work. I'm curious why it is needed, though, since the ORIGINAL TRVEdit is ALREADY linked to the same TRVStyle object as the table-containing TRVEdit.

Why doesn't this accomplish the same thing as transferring the data into a second TRVEdit that's also linked to this TRVStyle object?

If this is VERY complicated, no need to explain - I'm just curious and happy to get the workaround :-)

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

Post by Sergey Tkachenko »

I guess these new font styles are already removed from RVStyle when you load RVF.
Post Reply