GetItemStyle returns value of six

General TRichView support forum. Please post your questions here
Post Reply
tomr
Posts: 34
Joined: Wed Dec 09, 2020 9:36 am

GetItemStyle returns value of six

Post by tomr »

Hello RichView Support,

I have pasted a hyperlink into a RichEdit control, and while debugging, I noticed something unexpected:
The ItemStyle of the hyperlink returns the value 6.
Return Value six.png
Return Value six.png (3.86 KiB) Viewed 984 times
However, according to your documentation, the collection of text styles only goes up to number 5.
Collection of TextStyles.png
Collection of TextStyles.png (25.18 KiB) Viewed 984 times
Am I missing something here, or is 6 (perhaps rvsJump) a predefined style outside of the user-defined collection?


Thank you in advance for your clarification!

Best regards
Tom
Sergey Tkachenko
Site Admin
Posts: 17858
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: GetItemStyle returns value of six

Post by Sergey Tkachenko »

The values in this table are indexes of initial styles. These styles are added to TRVStyle.TextStyles by default, but you can add and delete them.

While editing (including insertion from a file or the clipboard), new styles can be added. Editing operation do not delete styles, but they can add new styles.
For a text formatting that already exists in TRVStyle.TextStyle, the editor re-uses existing items.
But if the inserted file contains a text formatting that do not exist in TRVStyle, the editor may add a new item to represent it.

Style handling options on insertion depend on the format of the inserted file.

RichView Format (RVF)

Depending on RVFTextStylesReadMode property, the component cn:
- add new styles, or
- use the most similar existing styles,
- ignore text properties and use indexes of styles

RTF and DocX

Depending on RTFReadProperties.TextStyleMode property, the component can
- add new styles, or
- use the most similar existing styles,
- use the style with the specified index

HTML and Markdown

The editor always adds new styles when necessary.

Similar properties exist for paragraph styles.
Post Reply