TParaInfos.FindSuchStyle, FindSuchStyleEx

<< Click to display table of contents >>

TParaInfos.FindSuchStyle, FindSuchStyleEx

Searches for a style having properties like Style.

function FindSuchStyle(BaseStyle: Integer; Style: TParaInfo;

  Mask: TRVParaInfoProperties): Integer;

function FindSuchStyleEx(BaseStyle: Integer; Style: TParaInfo;

  Mask: TRVParaInfoProperties): Integer;

(Introduced in version 1.5 and version 14)

The BaseStyle-th style is checked first. BaseStyle is an index in Items.

Mask is a set of properties to compare (other properties are ignored). Use RVAllParaInfoProperties constant to compare all properties.

The following properties are ignored when comparing styles:

Standard;

StyleName (if RichViewCompareStyleNames=False (default)).

If FindSuchStyle cannot find the desired style, it returns -1.

If FindSuchStyleEx cannot find the desired style, it adds a new style to the end of Items, assigns properties of Style to this new item, sets its Standard=False, returns the index of this new item.

Return value:

Index of the found style; FindSuchStyle returns -1 if not found.

See also methods:

FindStyleWithAlignment;

TRVStyle.FindParaStyle;

TParaInfo.IsEqual;

TFontInfos.FindSuchStyle;

TRVListInfos.FindSuchStyle.

Demos:

Demos\*\Editors\Editor 2\

(see procedure TForm1.rveParaStyleConversion, rve.OnParaStyleConversion event)