[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: [KSpread] not storing user input
From: "Ariya Hidayat" <ariya () kde ! org>
Date: 2005-04-02 19:56:48
Message-ID: 1912432839 () web ! de
[Download RAW message or body]
Hello guys,
As I wrote before, I may try an attempt to modify KSpread so it does not store
user input, i.e. when you type a value or a formula to the cell, what you type
is not stored. Instead, only the value or formula is stored. AFAICS Excel and
Gnumeric (and I'm sure OO.o as well) do this as this is The Right Thing.
So that I won't miss anything, I'd like to post first the changes that will be
made. I would appreciate comments and feedback.
strOutText() will be changed to displayedText() for clarity. This is the text
which is _shown_ in the screen. For example, if the cell contains a formula
than displayedText will be the computed result, properly formatted according
to the specified cell's format (e.g. precision).
strText() will be gone. Either use value(), which will be correctly set even
if the cell holds a formula, or use displayedText().
New function (feel free to propose better name): void render(). Given the
cell's value, either as entered by user or from the formula, and the cell's
formatting, render() will find out 'displayedText'. This function can be made
so that it is executed "just-in-time" but for first try let's call it from
setValue(), setFormula(), or when the format is changed (paint dirty and
friends)
There is no setDisplayedText() as it will be managed by render() above.
New function: void setUserInput( const QString& text ). If the user enters
some text into a cell, this text will be passed to setUserInput() and this
function is responsible to handle it, i.e. if it starts with equal(=) sign
that it will become the formula, else try to parse it to get the
corresponding value (might also be an error).
New function: QString userInput() const. This function should return a text
which is editable by user, e.g. if s/he presses F2 to edit cell content.
The text itself will be deduced from cell's formula or value (and possibly
with its format).
With regard to setUserInput(), some time ago OpenOffice.org project has
a new description on how to smartly parse user input (which is planned for
version 2.0), but seems I can't find the document anymore. For userInput()
troubles might arise e.g. in date/time value or such similar input.
Of course, another remaining question is whether I can make it just before the
freeze...
Best regards,
Ariya Hidayat
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
_______________________________________________
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