GNOME Bugzilla – Bug 339834
Some cells cannot be assigned function values, only text
Last modified: 2006-04-27 19:14:38 UTC
Please describe the problem: I am not sure the exact circumstances required to create these cells -- they happen for me only in fairly complex sheets. What happens is that I assign a function to a cell, possibly as the result of an autofill, and after this point I am never allowed to edit this function without it forcibly converting the cell to text type. Once this text conversion occurs, the cell can never again be assigned a function value -- any attempt to do so will result in gnumeric automagically adding a preceeding single quote. Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information: I will upload an example spreadsheet with just one such cell in it (that I copied from my complex sheet -- interestingly, the property survives cut and paste).
Created attachment 64337 [details] Spreadsheet with one such problem cell, as described in bug report.
Cell has been formatted as "text" so this is expected behaviour.
Ah, excellent I should have noticed that. This leads me to ask: If I have a cell with a formula in it, and I format that cell as text, why does it not add the quote immediately? Currently it will retain the formula behavior until I try to change it, at which point it prepends the quote...
Formatting never changes the value in the cell. It (obviously) changes the display of a cell's value. It (less obviously) changes the way new entries are interpreted. Besides text, dates and fractions are affected too. The only thing that makes text special is that it suddenly can become impossible to re-enter the cell's current contents. We could conceivably pop up a warning dialog the first time one tries to edit such a cell.
I see. As you have noticed, this completely baffled me. I intentionally chose text formatting because I knew the results of the cell's function to be of string type. Then I forgot about the formatting, and eventually became very frustrated that I could never change the formula... I re-assert that this is in some way a bug :-) I suppose the pop-up would be workable, but seems a bit inelegant... I sometimes use plugins to clobber cell values (intentionally) without changing their formatting, and this could produce odd behavior... If you are willing to impose value changes later on (which I am not sure is really such a great idea), why the resistance to immediately changing the value when the formatting is imposed to "ensure it is really text"?
I'm not willing to impose any value changes as a result of a format change. I am willing to issue a warning when someone hit F2 or anything else that starts an edit: Warning: this cell has been formatted as text after it was assigned an expression [or a numeric value or whatever]. Anything you enter in this cell will become a string. [ ] Don't show this message next time. [Edit] [Remove text format] [Cancel] Plugins should not be affected. They should almost never use sheet_cell_set_text [which parses strings and is locale dependent] but call, e.g., sheet_cell_set_expr instead.
Such a dialog is in place.