Read Only style not Read Only after reopening

General TRichView support forum. Please post your questions here
Post Reply
johnF
Posts: 27
Joined: Mon Feb 02, 2015 4:41 pm

Read Only style not Read Only after reopening

Post by johnF »

Hi,

I've made a couple modifications to RVEditDemo:

1. Added a Text Style with ModifyProtect & DeleteProtect = true and colour = MoneyGreen

2. Added a Paragraph Style with Read Only = true and BackgroundColour = MoneyGreen

3. Added opening HTML files using RvHtmlViewImporter


But it doesn't work as I expect:

1. I set some text to use the style, and a paragraph to use its style. At this point the Protection/Read Only works for both ok.

2. Save the file as HTML.

3. Reopen the HTML file.

The text and paragraph both have the colours from the styles, but they are not protected.

When clicking on the text, The comboboxes at the top do not change to the styles, they go empty.


Is this a bug, or is there a function/setting to load/compare the RV Styles with the CSS?

Regards, Jim.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Protection property are stored only in RVF. If you save and reopen HTML or RTF, they will be lost.
When choosing an existing style for using for given formatting loaded from HTML, the component ignores Protection property. If two text styles have identical visual attributes, the style with a lesser index will be used.
johnF
Posts: 27
Joined: Mon Feb 02, 2015 4:41 pm

Post by johnF »

When choosing an existing style for using for given formatting loaded from HTML, the component ignores Protection property. If two text styles have identical visual attributes, the style with a lesser index will be used.
That is what I was expecting/hoping. Instead, it is creating a new style.

Code: Select all

span.rvts13 /* Read Only */
{
 color: #c0dcc0;
}

span.rvts17
{
 color: #c0dcc0;
}
rvts13 seems to get ignored because it has Modifiy and Delete protection = true. Can an option be added so it will match styles even if they have protection?

Thanks, Jim.
johnF
Posts: 27
Joined: Mon Feb 02, 2015 4:41 pm

Post by johnF »

Alternatively, would it be possible for TRichView to use prefixes (CSS Extensions) the same way Mozilla & Webkit do?

-moz-
-webkit-
-trichview-

https://developer.mozilla.org/en-US/doc ... Extensions

This way TRichView could save any of its features in HTML/CSS.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Well, I was wrong when I wrote that non-HTML properties are ignored when loading from HTML. Actually, the desired values of these properties are taken from TextStyles[0].

We will think about custom CSS attributes when TRichView implements its own native HTML import, without additional components.
Post Reply