Improvement of the styles handling in Calligra

Inge Wallin inge at lysator.liu.se
Tue Apr 17 08:05:39 BST 2012


On Tuesday, April 17, 2012 07:09:51 C. Boemann wrote:
> On Tuesday 17 April 2012 03:27:39 Inge Wallin wrote:
> > > If a inherited style overwrites one property of a style e.g. the color
> > > a new KoShapeBackground would be set in the inherited style.
> > 
> > That could work, yes. It will be somewhat complex to create the style
> > again on saving.  Here is a problem:
> > 
> > Say that we have two styles, A and B. B inherits A.  We have two
> > attributes x and y which could be set in A, B or Both.  x and y together
> > create the complex value Z.  Now suppose both x and y are set in A,
> > creating a Z value for style A.  And x is changed in style B meaning
> > that in our binary representaiton we will have another value for Z in B.
> > Now when we want to save the styles back to a file, there is no way for
> > us to know if y was set in B to the same value as in A or if it was left
> > unspecified and just inherited its value from A. This makes a difference
> > if the value of y in A is ever changed.
> 
> But we should never touch A in calligra, which is sort of what I hear zagge
> saying too. If we always modify the autostyle on top, then saving back
> while retain the inheritance and the values in A (so that data is not lost
> for people loading it back into LO/OO)

First, I don't agree. We might not want to touch it in Words (the jury is 
still out on that one) but I can see some definite value of touching it in, 
say, Flow. Changing whole diagrams by changing a graphic style would be much 
in line with what that applicaiton does.

Second, it is irrelevant for the discussion.  *If* somebody changes A even 
outside Calligra (and OOo and LO has the features to do it) then we should not 
have destroyed the information in B. So we need to be able to keep the 
information even while saving memory. The whole point of the proposal is to 
keep the information that is already in the file, regardless of if we allow 
the user to change it or not.



More information about the calligra-devel mailing list