Style objects for applications and filters

Thorsten Zachmann t.zachmann at zagge.de
Sun May 4 05:18:45 BST 2014


On Monday, April 28, 2014 10:31:45 PM Inge Wallin wrote:
>  * Represent styles as text attributes wherever possible so that they can be
> complete, i.e. not throw away style data.

I'm not conviced that this is a good idea. We tried to do that with the 
KoUnavailShape to prevent what we can't save but as far as I remeber LO and OO 
where unfortunately not able to load the stuff we saved back. 

Also saving back styles might result in unwanted behaviour. See the following 
example:

User 1 creates a document with styles in LO.
User 2 loads the document with calligra.
User 2 copy and pastes something with unsupported formating options.
User 2 formats it as he wants it to be. (however as he copied something he 
can't see he also has a format in there which will result in something 
different then expected when loaded)
User 2 save
User 1 loads in LO and the formating of the pasted text is not what User 2 
wanted.

Sure if User 2 only fixes a typo this is not a problem but if a user really 
works with a document it can happen in quite a lot supricing side effects the 
user can't forsee and therefore I against this.

There are interdependencies between styles that can't be saved by in the way 
you described as it will need to update references and so on. Also I could not 
find something in the specification that says a reader/writer should support 
stuff  he does not understand.

>  * Implement a binary interface for some (in the long run all) attributes so
> that we retain the advantages of that (mostly speed).

If we go the route you propose then I would propose to add the new stuff as 
addition to what is there.

>  * Because all our apps use DOM parsing now (even if stream reading is used
> under the hood) and many filters use stream parsing, I want to provide both
> variants of the loadOdf() method.

More code means more bugs so I'm not really convinced here.  At least quite a 
lot of testing for that is needed.

So I'm not really convinced this is a good idea.

Thorsten



More information about the calligra-devel mailing list