CHeaderFooter
Typically, the SetText()
function should be used as demonstrated below to set the rich text object which is owned by the header or footer. The previously owned rich text object and format layers should be deleted if they are no longer required. The global paragraph and character format layers which are referenced by the rich text object may be retrieved as demonstrated below. The CONST_CAST
macro is used here to remove the const
-ness of the returned pointers.
delete iPrintSetup->Header()->Text();
delete iPrintSetup->Header()->ParaFormat();
delete iPrintSetup->Header()->CharFormat();
iPrintSetup->Header()->SetText(richText);
iPrintSetup->Header()->SetParaFormat(
CONST_CAST(CParaFormatLayer*,richText->GlobalParaFormatLayer()));
iPrintSetup->Header()->SetCharFormat(
CONST_CAST(CCharFormatLayer*,richText->GlobalCharFormatLayer()));