Page 1 of 1

GetItemStyle returns value of six

Posted: Thu Jul 03, 2025 11:20 am
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 399 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 399 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

Re: GetItemStyle returns value of six

Posted: Thu Jul 03, 2025 7:02 pm
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.