OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

office-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [office-comment] User-defined character and paragraph styles

I found just another use-case.

After reading *add list level attribute to style:style*, it came to my 
mind that inheritance is a much more flexible and powerful method to 
solve that request. [I have however to warn, that I did not understand 
everything from that issue and that I am not very versed in the 
ODF-specification, especially in the XML-schema.]

Using inheritance, the user just defines 2 styles containing the 
level-attribute:<style 1> and <style 2>. This are only "partial styles" 
in that they do not contain any further information.

When a user drag-drops these styles over an existing paragraph (or 
another style), then the existing style inherits this style.

An explicitly defined property within the wrapper style will take 
precedence over any inherited property. Therefore, if a user changes a 
property, the explicitly defined one will take precedence and there are 
NO conflicts to resolve.

This is a far more structured and flexible approach then presented. It 
also covers more broadly any property.



P.S. explicit example:
inheritance is marked with "<--"
<para style 1> {some properties}
<para style 2> {some properties}

<list style X> {some properties}
<list style Y> {some properties}

<para style 1> <-- <list style X>
<para style 2> <-- <list style Y>

para 1: assign <para style 1>
para 2 - n: assign <para style 2>
para (n+1): assign <para style 1>

Instead of assigning <para style i>, the user would actually assign the 
<list style i> directly to the underlying paragraph, which would then 
inherit the list style and therefore the properties from the list style. 
In this particular instance, the list style would contain only the 
"outline level" property (and maybe some other formatting attributes).

Leonard Mada wrote:
> Dear ODF-TC Members,
> while reading one proposal for ODF, I came up with a better idea.
> [for original proposal see 
> http://wiki.oasis-open.org/office/User-defined_character_and_paragraph_styles] 
> Instead of defining explicitly every element-style that can be 
> inherited by another style, I would solve this issue more broadly:
> ======================
> Define an INHERITANCE mechanism, e.g.
> style <X> inherits from style <Y>, <Z>, ...
> This would be transcribed as:
>  - ANY property of X that is defined in Y is inherited from Y.
>    [and not explicitly defined in X]
>  - IF there are further properties defined in Z, those get inherited 
> from Z,
>    and so on.
>    [Y has precedence over Z, ...]
> Therefore, the example from the wiki could be easily solved via:
> <paragraph style> _P_Name_ inherits from <character style> _C_Name_
> As I don't understand XML, this is only a tentative schema:
> <define name="style-style-content" combine="choice">
>    <group>
>        <attribute name="style:family">
>            <value>paragraph</value>
>        </attribute>
>        <optional>
>        <attribute name="style:inherit">
>            <value>style_name_from_which_it_is_inherited</value>
>        </attribute>
>        </optional>
>        <optional>
>            <ref name="style-paragraph-properties"/>
>        </optional>
>     ...
>    </group>
> </define>
> This option is more flexible and it is possible to inherit various 
> attributes from different styles, e.g. the text-size from one 
> char-style, the font-name from a different style, ... .
> =====
> Circular references won't lock the inheritance mechanism, because an 
> attribute that is not present in either style, is not defined, so will 
> be ignored. Therefore, an implementation detail would be (but not 
> necessary for ODF to specify): list all properties in all styles. 
> Resolve inherited properties only if present in this list and a 
> suitable graph can be build for that property.
> Sincerely,
> Leonard
> P.S. This would enable a nice mechanism for the page to inherit 
> atributes defined for an element displayed on that page!

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]