Hello,
I've got a behaviour in WPTools in don't understand. I'm building a very complex document out of a Database.
A use 2 TWPRichEdits to build the Document. In one RichEdit I build blocks which I append to the other RichEdit.
If I only build the blocks and append them together in the second TWPRichEdit everything works fine.
But as soon as I change some formatting in the second document all the font information from the first RichEdit gets lost (except the underlined property). This only happens with Text I built in code. The text the users entered (I append some text using ->SelectionAsString = TextFromDB) stays nicely formatted, though it is also in RichEdit1.
I use this to format my text:
Cardinal headline;
TWPStoredCharAttrInterface *cha_txtplain = new TWPStoredCharAttrInterface(rt_Preview->RTFData);
cha_txtplain->Clear();
cha_txtplain->SetFontName("Arial");
cha_txtplain->SetFontSize(20);
cha_txtplain->IncludeStyle(afsBold);
cha_txtplain->ExcludeStyle(afsItalic);
cha_txtplain->IncludeStyle(afsUnderline);
cha_txtplain->SetColor(clBlack);
headline = cha_txtplain->CharAttr;
delete cha_txtplain;
//Text input via
par->SetText("Text",headline);
Alles anzeigen
It looks like the component can't handle it if there are Cardinals from 2 different TWPRichEdits in one Document. Or is there a better way for general formatting of texts in code?
Thanks for your help!!!
Florian Fanderl