From koffice-devel Mon May 20 18:59:47 2002 From: David Faure Date: Mon, 20 May 2002 18:59:47 +0000 To: koffice-devel Subject: Re: KSpread formulas X-MARC-Message: https://marc.info/?l=koffice-devel&m=102192138921549 On Monday 20 May 2002 12:31, Ariya Hidayat wrote: > (1) making a cell value stored in KSpreadValue class. KSpreadCell is quite > a mess with value handling and so on. and we don't need integer, all > number are just numbers (should be double) I'm not sure this is a wise move. 4 == 4 for integers, but sometimes 4.0 != 4.0 for floating point values. You get trouble when trying to use floating point numbers for ints .... unless maybe you do a correct rounding for the ints (not just truncation). The idea of KSpreadValue sounds good though, mainly for more code modularity. But I suggest to use an union for the different possible kinds of values - or a QVariant. > (2) define 'format', i.e how the cell value should be displayed, e.g > precision, currency, and so on. should be put in class KSpreadFormat. and > this is likely to be shared among. cells will "apply" a prefined/custom > format. improving cell formatting with Excel would be possible. OTOH it > also reduces KSpreadCell again. > > (3) define 'layout', which somehow already there (KSpreadLayout). layout > defines apperance of the cell, e.g border, color, font, etc. think of > value vs format+layout like document vs view. Sounds good. > (4) if we have (2) and (3), it should be difficult to have 'style'. It shouldn't, I suppose you mean ;-) For the sharing I suggest a quick look at KoTextFormat and KoTextFormatCollection (the idea of the dict, the key that represents the whole format as a string, etc.). The only tricky bit is the ref-counting (because it's not automatic, it's explicit in the code using KoTextFormat...). -- David FAURE, david@mandrakesoft.com, faure@kde.org http://people.mandrakesoft.com/~david/ Contributing to: http://www.konqueror.org/, http://www.koffice.org/ KDE, Making The Future of Computing Available Today _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org http://mail.kde.org/mailman/listinfo/koffice-devel