Cell Streaming does not save Styles
Posted: Fri Oct 14, 2005 3:16 pm
Hello,
I am trying to stream a cell's contents (with all styles) into a stream to later insert it into a different TDBRichViewEdit control with a different TRVStyle. No matter how I go about it, all I seem to be getting in the stream (I am saving it to a file to see what's there) is the text of the cell with Style indices, but not the Styles themselves. Since I'm using a different pair of RV/Style controls as targets where I end up inserting/appending/whatever the stream, the Style information gets lost.
The relevant portion of the code I am trying to use is:
TMemoryStream *MS = new TMemoryStream;
TRVTableCellData *Cell = Table->Cells[0][0];
Cell->SaveRVFToStream(MS, false, clNone, NULL, NULL);
Alternative (B) (to the last line above):
TCustomRVData *CRVD = Cell->GetRVData();
CRVD->SaveRVFToStream(...);
Or (C):
TRVTableInplaceRVData *CED = (TRVTableInplaceRVData *)Cell->Edit();
CED->SaveRVFToStream(...);
Or even (D):
TCustomRichViewEdit *CEDRV = (TCustomRichViewEdit *)CED->GetParentControl();
CEDRV->SaveRVFToStream(MS, false);
I have also tried SaveRVFToStreamEx(MS, rvfss_Full, clNone, NULL, NULL) for the first 3 (RVData) variants.
In all cases, I am getting the exact same output that looks like this:
-8 1 3
0 1 0 0 0 0
abc
22 1 -1 1 0 0
def
0 1 -1 1 0 0
ghi
23 1 -1 1 0 0
jkl
What I seem to be missing is the actual Styles #22 and #23 for "def" and "jkl".
The source TDBRichViewEdit is already in the "Allow adding styles dynamically" mode (which happens to be the default). The only non-default setting I can think of is: rvoTagsArePChars is true. I'm using version 1.9.
Is there something I'm doing wrong? Is there a (known) limitation related to Cell streaming? If so, is there a workaround?
Thank you in advance,
Michel
I am trying to stream a cell's contents (with all styles) into a stream to later insert it into a different TDBRichViewEdit control with a different TRVStyle. No matter how I go about it, all I seem to be getting in the stream (I am saving it to a file to see what's there) is the text of the cell with Style indices, but not the Styles themselves. Since I'm using a different pair of RV/Style controls as targets where I end up inserting/appending/whatever the stream, the Style information gets lost.
The relevant portion of the code I am trying to use is:
TMemoryStream *MS = new TMemoryStream;
TRVTableCellData *Cell = Table->Cells[0][0];
Cell->SaveRVFToStream(MS, false, clNone, NULL, NULL);
Alternative (B) (to the last line above):
TCustomRVData *CRVD = Cell->GetRVData();
CRVD->SaveRVFToStream(...);
Or (C):
TRVTableInplaceRVData *CED = (TRVTableInplaceRVData *)Cell->Edit();
CED->SaveRVFToStream(...);
Or even (D):
TCustomRichViewEdit *CEDRV = (TCustomRichViewEdit *)CED->GetParentControl();
CEDRV->SaveRVFToStream(MS, false);
I have also tried SaveRVFToStreamEx(MS, rvfss_Full, clNone, NULL, NULL) for the first 3 (RVData) variants.
In all cases, I am getting the exact same output that looks like this:
-8 1 3
0 1 0 0 0 0
abc
22 1 -1 1 0 0
def
0 1 -1 1 0 0
ghi
23 1 -1 1 0 0
jkl
What I seem to be missing is the actual Styles #22 and #23 for "def" and "jkl".
The source TDBRichViewEdit is already in the "Allow adding styles dynamically" mode (which happens to be the default). The only non-default setting I can think of is: rvoTagsArePChars is true. I'm using version 1.9.
Is there something I'm doing wrong? Is there a (known) limitation related to Cell streaming? If so, is there a workaround?
Thank you in advance,
Michel