Function TWPAbstractCharAttrInterface.GetStylesEx(styles_on:WrtStyle; styles_mask:WrtStyle) : Boolean
Unit: WPRTEDefs
Class: WPRTEDefs.TWPAbstractCharAttrInterface
Parameters
Returns
The type of the result value is Boolean.
Description
This function reads the character styles which are defined and also the character style mask. If an element is set in styles_mask but not set in styles_on variables this means the attribute is switched off. The variables are not initialized, the defined values are added to the sets. The negation of the existing value of styles_mask is used to mask the added values. This means that the existing value is protected. This method is the TWPAbstractCharAttrInterface version ofThis code is used to calculate the current style by the CurrAttr object:
function TWPSetModeControl.GetStyle: WrtStyle;
var stymask, styon : WrtStyle;
begin
if Cursor.IsSelected then
begin
if not Cursor.SelectedTextAttr.GetStyles(Result) then Result := [];
end else
begin
stymask := [];
styon := [];
Cursor.WritingTextAttr.GetStylesEx(styon, stymask);
if (Cursor.active_paragraph<>nil) then
begin
Cursor.active_paragraph.AGetStylesEx(styon, stymask);
if Cursor.active_paragraph.ABaseStyle<>nil then
Cursor.active_paragraph.ABaseStyle.AGetStylesEx(styon, stymask);
end;
FRichText.DefaultAttr.GetStylesEx(styon, stymask);
Result := styon * stymask;
end;
end;