A user found the following bug in a system i wrote. This is written in Delphi 2007 using v5.40 of WPTools.
In a nutshell, the editor is very simplified. A single line of text can only be one font size, etc, so the commands in general apply to the "current line".
I sent the font size for a line with the following code:
WPRichText1.TextCursor.SelectLine;
WPRichText1.TextCursor.SelectedTextAttr.SetFontSize(fs);
WPRichText1.HideSelection;
I then set the justification like this:
case _Tag of
0:
WPRichTExt1.CurrAttr.Alignment := paralLeft;
1:
WPRichTExt1.CurrAttr.Alignment := paralCenter;
2:
WPRichTExt1.CurrAttr.Alignment := paralRight;
end;
The issue that came up seems to arise ONLY when working with the last line in the editor.
For example, they set a font size for the last line, then center-justify that line. What happens is it is center justified, but the font size reverts to the previous size.
Why would this happen? Something to do with line enders?
Thanks,
alan