WPTools 6.13
Please have a look at the following code (obviously we don't have code like this but sometimes we clears the document and rebuilds it using some dynamic definitions).
Code
void createContent(Wpctrrich::TWPRichText* aEditor) {
aEditor->WritingAttr()->Clear();
TParagraph* p(aEditor->FirstPar->AppendNewPar(true));
TWPStoredCharAttrInterface* style(aEditor->AttrHelper());
style->Clear();
p->InsertNewObject(0, wpobjTextObject, false, false, style->CharAttr)->Name = WPTextFieldNames[wpoPageNumber];
}
void test() {
createContent(Editor);
Editor->Clear();
Editor->CheckHasBody();
createContent(Editor);
Editor->ReformatAll(true, true);
}
Alles anzeigen
If you only do the first line (createContent) everything looks fine. If all lines are executed the style becomes broken (more so if the autofield is placed inside a cell with border and alignment for example). This problem only seems to occur for autofields. So, is there something I'm missing here (kinda urgent as the same problem occurs during printing which makes this a showstopper)?
Regards
patrik.nyborg(a)genicore.se