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

List:       koffice-devel
Subject:    Re: KSpread: Style Storage
From:       "Robert Knight" <robertknight () gmail ! com>
Date:       2006-06-22 18:32:45
Message-ID: 13ed09c00606221132v7b036fe7me1a5215d503004f2 () mail ! gmail ! com
[Download RAW message or body]

Hi,

The approach Ariya outlined (If I understand correctly) and I expanded
upon in my first reply is essentially what Gnumeric does.  In short:

1)  Uses a combination of hash tables and quad-trees to store style information
2)  Each style specifies a subset of all the possible properties.
3)  Style regions overlap
4)  Cache merged styles for frequently looked-up cells

> R+-tree is a smart choice for this particular style rect that you use.

But what benefits does this have over a Quad-Tree?  Unless there are
notable performance or memory usage benefits then it would seem
sensible to pick the simpler solution (the Quad-Tree) which requires
less code and will be easier for other devs to understand and tweak.

Regarding operations that move formatting around (including reversing
formatting in a list for example), I think the easiest option is to
place a "blank" style region covering the entire target area and then
copy the styles cell-by-cell from the source area on a per-property
basis such that only one style region is created for adjacent cells
which share the same value for a property.  eg.  If a list of cells of
size n being sorted all had different background colours, but the same
'bold' appearence, then the number of new regions created would be:  1
for the blanking region + n for the different background colours + 1
for the bold region.

Undoing operations is extremely easy, just remove the most recently
added style piece.

Regards,
Robert.

On 22/06/06, Stefan Nikolaus <stefan.nikolaus@kdemail.net> wrote:
> On Thursday 22 June 2006 15:53, Ariya Hidayat wrote:
> > > Are you sure that this really is the best approach ? I don't know, I
> > > personally somehow just don't like it much :( How do OpenOffice and
> > > Gnumeric store formatting ?
> [...]
> > If someone can compare this to Gnumeric and OO, that'll be lovely. FYI
> > my idea from this pieces storage came from MS Excel (at least, its
> > file format).
>
> Some pointers for OO:
> http://sc.openoffice.org/row-limit.html#Document structure overview|outline
> http://sc.openoffice.org/source/browse/sc/sc/inc/attarray.hxx?view=markup
> http://sc.openoffice.org/source/browse/sc/sc/source/core/data/attarray.cxx?view=markup
>
> Summarized: a 'dynamic' array per column.
>
> Calc operates with 256 columns at max. I don't want to see this restriction in
> KSpread.
>
> I will not dig further in that code...
> Stefan
>
>
> _______________________________________________
> koffice-devel mailing list
> koffice-devel@kde.org
> https://mail.kde.org/mailman/listinfo/koffice-devel
>
>
>
>
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://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