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

List:       koffice
Subject:    Re: KSpread cells
From:       Waldo Bastian <bastian () kde ! org>
Date:       2000-05-22 18:04:21
[Download RAW message or body]

On Mon, 22 May 2000, David Faure wrote:
> > Maybe this helps here - don't know exactly, because I'm not very
> > familiar with KSpread's internals.
>
> [...]
> Thanks for the explanation. I think it _partly_ applies here.
> The main difference is that a word document is linear (hence
> the idea of a count), whereas a spreadsheet is bidimensionnal.

What we did in khtml in the 1.1.2 days was that text-objects had a pointer to 
a formatting object. Whenever a new text-object is created with the same 
formatting as the previous text-object, we just copied this pointer.

When a text-object with a new formatting is created, you can look into the 
list of formatting objects to see if you already have such a formatting 
object and reuse that. Otherwise you have to create a new one.

With khtml we kept it quite simple, but it would be easy to add ref-counting 
so that you know whether a formatting object is still in use.

If you expect to get _a lot_ of formatting objects, you need to optimize the 
way you check whether you already have a certain formatting object. This is a 
typical job for a hash-table. I don't think this is really necassery in the 
case of kspread though. (If you have spreadsheet with 30000 rows you don't 
give each row a different font :-)

Cheers,
Waldo

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

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