[WebODF] RFC: Making OpApplyStyle and OpUpdateParagraphStyle more consistent

Friedrich W. H. Kossebau friedrich at kogmbh.com
Wed Jul 24 21:38:19 CEST 2013


Hi,

OpApplyStyle and OpUpdateParagraphStyle are currently quite different:
a) how they encode the style attributes to change
b) OpApplyStyle does not really support unsetting of attributes
c) OpApplyStyle and related code only does textstyle properties
d) OpApplyStyle does not directly modify existing styles, but create any 
needed automatic styles to have the given styling
e) OpApplyStyle has a too generic name


Before I start to write anything for OT of OpApplyStyle things needs to be 
cleaned up a little, to reduce the complexity due to the different behaviour.


For a) OpApplyStyle takes some "info" payload that are actually directly the 
ODF element names and properties+values that should be set to the direct 
formatting. The names of the property and attributes use the usual prefix to 
indicate the namespace. OpUpdateParagraphStyle instead has a "setProperties" 
payload that carries the properties+values to set, with an own id scheme that 
first needs to be mapped to the ODF values.

Q: anyone would mind to rename that "info" property to "setProperties", for 
some more entropy in the name?
Okay to remove the custom property names and mapping in OpUpdateParagraphStyle 
and use directly the ODF attribute names as well?


In matters of b), OpUpdateParagraphStyle has a payload "removedProperties" 
which stores the names of all attributes that should be removed. That was done 
like that instead of listing the attribute with value >null<, >undefined< or 
"" in the "setProperties" to express that is should be removed, because >null< 
and >undefined< might not exist in other languages and "" could be an actual 
valid value.

Q: does it make sense to add something similar like "removedProperties" to 
OpApplyStyle? I guess it does.


For c) I wonder what the plans are for paragraph styling. There is no TODO or 
anything else mentioned. And I am only thinking of the op spec, not of the 
actual implementation how to execute this op.

Q: Should the same op be used for direct paragraph styling? So should there 
be, like in OpUpdateParagraphStyle, another section "paragraphProperties", 
next to "textProperties"? 


The difference mentioned in d) seems wanted, as this op is rather a direct 
mapping of some UI action, like we have with OpRemoveText or OpSplitParagraph. 
So no question about that issue.


WRT e), I propose the name "OpApplyDirectStyling"

Q: Better name?


Cheers
Friedrich
-- 
Friedrich W. H. Kossebau // KO GmbH
http://kogmbh.com/legal/


More information about the WebODF mailing list