TCustomRichViewEdit.ApplyParaStyleTemplate

<< Click to display table of contents >>

TCustomRichViewEdit.ApplyParaStyleTemplate

Applies the specified style template to the selected paragraphs.

procedure ApplyParaStyleTemplate(TemplateNo: Integer; 

  ResetAdditionalFormatting: Boolean; Recursive: Boolean=True);

(introduced in version 14)

This procedure assigns the specified style template to paragraph styles of items in the selected paragraphs.

Parameters:

TemplateNo index in the collection Style.StyleTemplates, or the value -1. The value -1 means a format clearing (see below). The style template must have Kind = rvstkParaText or rvstkPara.

If ResetAdditionalFormatting=True, all properties of the specified style template will be applied. If ResetAdditionalFormatting=False, only "unmodified" properties (see below) will be changed. This parameter is ignored if TemplateNo=-1.

If Recursive = False, this method does not change styles in cells of selected tables (except for the case of multicell selection in a single table).

 

This method does nothing if UseStyleTemplates=False and TemplateNo>=0.

If paragraphs are formatted with styles having rvpaoStyleProtect in their Options, this method skips them.

Format clearing

A format clearing means the following procedure. If "Normal" style template exists, the method works like applying this style template with ResetAdditionalFormatting=True. If it does not exist, the method resets all properties of paragraph styles to default values, and assigns StyleTemplateId=-1.

If UseStyleTemplates=False and TemplateNo<0, the results are identical to calling ApplyParaStyle(0).

Modified properties

Properties of a paragraph style are considered modified, if they have values different from values of the corresponding properties of the current style template (referred in StyleTemplateId property). If a style template is not assigned, the properties are considered modified if they have non-default values. The method ignores ModifiedProperties property (it calculates this property itself).

 

Method type: editstyle editing-style.

See also:

ApplyTextStyleTemplate;

ApplyParaStyleConversion;

ApplyParaStyle.