Page 1 of 1

Read Only style not Read Only after reopening

Posted: Tue Feb 03, 2015 4:50 pm
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.

Posted: Wed Feb 04, 2015 11:22 am
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.

Posted: Wed Feb 04, 2015 11:57 am
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.

Posted: Mon Feb 09, 2015 9:45 am
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.

Posted: Mon Feb 09, 2015 6:30 pm
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.