[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: improving speed of painting
From:       Norbert Andres <nandres () web ! de>
Date:       2002-09-02 21:42:18
[Download RAW message or body]

> > For everything else OpenCalc calls it automatic-styles. So if you have
> > default cells and change, lets say A1 and A2 to have a bold font, they
> > share there own font style - an automatic-style - and will still have the
> > same style for the rest of the formats: borders, background,...
> > A1 and A2 share an automatic-font-style, while the rest really signs up
> > for Default or something else, so if you change the default style, you
> > change all cells (which have no automatic-style). But you cannot change
> > automatic-styles intentionally - they get created and managed internally
> > only with ids instead of real names. Hmm, complicated - sometimes it
> > would be great to meet personally to discuss things...
>
> Hmm, now I get it. So Calc using automatic-style, with a "base style" or
> something like that. I guess this is to save memory even more, although it
> will add another headache in the code. As a side note, is this the Calc
> file format or were you looking at the code ?
I looked mostly on the file format and the file format documentation.
I don't think that it is a real difference to what you mentioned (maybe just 
the name):
E.g. 
A1 changes it's font to bold 
=> deregisters from default style
=> creates it's own automatic-font-style and uses it

A2 does the same, font to bold:
=> deregisters
=> picks up the automatic-font-style already used by A1 and uses it

if A1 changes it's font again, e.g. to italic it does the same again:
=> decrease ref on old auto-style
=> new auto-style.

If A2 changes it to underline,
=> only user of "his" automatic-font-style
=> changes the auto style directly.

All the other automatic-styles (Background, border, number format, position 
(alignment)) are still shared, but not with the default style anymore, so 
changing the default style has no effect on A1 and A2.
It has some nice effects: small file size, faster loading time, less memory 
usage, faster saving time and it's is easy to save in 1.2 format and easy to 
load 1.2 formats. All of the current filter still work (the OpenCalc filter 
will really take advantage of it - I'm already thinking that loading OpenCalc 
files get loaded much faster than 1.2 files.

Instead of automatic-styles you can name it formats.

I haven't planned a real reference counting so that the a style does not get 
deleted if a KSpreadLayout still references it. Instead I have a "style 
manager" which maintains all the automatic, builtin and user defined styles.
(There is no GUI for it yet, so actually you can't change the built in ones 
and can't create your own, but this is just a small step)

I don't know how the performance is if you have really hundreds of different 
font styles, but I will test it in a few weeks. But normally if you have 
100.000 cells in a spreadsheet 999800 have the same font, borders,...
If we don't remove the "Recalc on Load" the user has completely different 
problems...

Also, this is more ment like a first step to start working on it. There is 
still room for improvements, tuning,... I didn't want to have something 
perfect for all aspects from the beginning, because you might never meet the 
end if you try to do that. 
And if we decided to do something completely different it wasn't a too big 
waste of time.

> As for meeting, occasionaly I'm hanging at #koffice at irc.kde.org. Feel
> free to go there if you have some time.
Ok, thanks.
>
> > Maybe I'll make my solution a little bit simpler for now, commit it and
> > then we can discuss from that point on. I think "Style" is good name for
> > it, but I'm open to change it anytime if we decide to. It's just a name
> > for now...
>
> Okay. And I'd like to hear also opinion from others, notably John.
If the code is there we can discuss it.

>
> > For gnumeric parsing it was easy, they have mapping tables :-) But I will
> > think about something - I already planned to do it, because the
> > flexibility for the user is much higher (OpenCalc uses it, too, although
> > it looks differently: 00.123,23 e.g. which "translates" to 00.###,## (I
> > guess:-))
>
> For starting point, Gnumeric has a good code on this stuff. If you could
> invest some time to get confused with its C code and
> very_very_long_variable_and_function_name, then go ahead :-)
Or I check with OpenCalc - it still has german comments in it ;-)

Norbert
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic