StyleLoadingMode in TRichViewXML
Posted: Mon Dec 10, 2007 1:55 pm
Hi there,
I'm working with RVXML, and trying to figure out how to get this to happen:
1. Save styles in the XML (this works fine).
2. Reload styles from the XML in such a way that if they're standard styles, they DON'T overwrite the standard styles in the TRVStyle component, but when they're non-standard styles, they load.
The problem I'm having is this:
Let's say I have two standard styles 0 and 1, called "NormalText" and "Hyperlink". Then I have a bit of bold text, which is based off style 0 but has bolding. Then the output XML looks like this:
<font backcolor="clWhite" color="clBlack" fontname="Arial Unicode MS" name="NormalText" unicode="1"></font>
<font color="clBlue" fontname="Arial Unicode MS" jump="1" hovercolor="clRed" nextstyleno="0" underline="1" name="Hyperlink" unicode="1"></font>
<font standard="0" italic="1" unicode="1"></font>
Now, in the application, the standard styles are changed such that the font for style 0 becomes Times New Roman. When the document is loaded back in, the base text DOES become Times New Roman, but the bolding is lost. This happens if I use
StyleLoadingMode = slmMap
If I use
StyleLoadingMode = slmMerge
then the text comes in as Arial Unicode MS, and not as Times New Roman. I'm not really sure from the documentation exactly what slmMap and slmMerge are supposed to do. Shouldn't slmMap map all standard styles to the existing styles in the TRVStyle, but also load any non-standard styles based on them? That doesn't seem to be happening.
Cheers,
Martin
I'm working with RVXML, and trying to figure out how to get this to happen:
1. Save styles in the XML (this works fine).
2. Reload styles from the XML in such a way that if they're standard styles, they DON'T overwrite the standard styles in the TRVStyle component, but when they're non-standard styles, they load.
The problem I'm having is this:
Let's say I have two standard styles 0 and 1, called "NormalText" and "Hyperlink". Then I have a bit of bold text, which is based off style 0 but has bolding. Then the output XML looks like this:
<font backcolor="clWhite" color="clBlack" fontname="Arial Unicode MS" name="NormalText" unicode="1"></font>
<font color="clBlue" fontname="Arial Unicode MS" jump="1" hovercolor="clRed" nextstyleno="0" underline="1" name="Hyperlink" unicode="1"></font>
<font standard="0" italic="1" unicode="1"></font>
Now, in the application, the standard styles are changed such that the font for style 0 becomes Times New Roman. When the document is loaded back in, the base text DOES become Times New Roman, but the bolding is lost. This happens if I use
StyleLoadingMode = slmMap
If I use
StyleLoadingMode = slmMerge
then the text comes in as Arial Unicode MS, and not as Times New Roman. I'm not really sure from the documentation exactly what slmMap and slmMerge are supposed to do. Shouldn't slmMap map all standard styles to the existing styles in the TRVStyle, but also load any non-standard styles based on them? That doesn't seem to be happening.
Cheers,
Martin