Issue 87974 - Problem inserting negative numbers
Summary: Problem inserting negative numbers
Status: CLOSED DUPLICATE of issue 91550
Alias: None
Product: Calc
Classification: Application
Component: editing (show other issues)
Version: OOo 2.4.0
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: spreadsheet
QA Contact: issues@sc
URL:
Keywords:
: 92331 (view as issue list)
Depends on: 20496
Blocks:
  Show dependency tree
 
Reported: 2008-04-07 07:54 UTC by vitriol
Modified: 2008-08-13 13:33 UTC (History)
7 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Fix for mouse click problem (doesn't work similar to cursor keys) (3.23 KB, patch)
2008-05-06 11:34 UTC, muthusuba
no flags Details | Diff
Updated patch (3.40 KB, patch)
2008-05-14 11:38 UTC, muthusuba
no flags Details | Diff
Updated patch. (4.63 KB, patch)
2008-05-19 09:25 UTC, muthusuba
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description vitriol 2008-04-07 07:54:39 UTC
A negative number is not accepted by clicking on another cell, but is managed as
a formula.
Steps to reproduce:
- In A1 type -1 and don't leave the cell
- Now click on B1
- Result: A1 now contain -1B1.

With unsigned numbers it works fine:
- In A1 type 1 and don't leave the cell
- Now click on B1
- Result: value 1 is accepted, and the cell B1 is selected

Thank you for your attention
Comment 1 discoleo 2008-04-07 20:12:18 UTC
Can confirm it with OOo 2.4 (final) on Win2k en-locale.

This is probably a regression of issue 20496:
http://www.openoffice.org/issues/show_bug.cgi?id=20496

It strikes me, that the cell is not converted to a formula, but one end e.g.
with a string like: -1A1
Comment 2 kpalagin 2008-04-08 05:09:21 UTC
Confirming with 2.4 on WinXP - as described.
Comment 3 bubblebobble 2008-04-14 22:27:04 UTC
Confirm the issue.
Ooo 2.4.0 final and Windows XP x86 Home/Professional.
Comment 4 muthusuba 2008-05-06 11:34:57 UTC
Created attachment 53413 [details]
Fix for mouse click problem (doesn't work similar to cursor keys)
Comment 5 muthusuba 2008-05-06 11:40:29 UTC
Other possible problems:
A)
1. Enter a formula (starting with '+') say '+10+20'
2. verify the cell has 30
3. Click Undo
4. Click Redo
(now the cell value changes to +10+20 instead of 30)

B)
1. Enter a formula with ref. say '+10+A1'
2. verify the cell has value 10
3. Now try changing A1 to something else by double clicking on A1 and choosing
another cell (say B1)

(see also issue 20496)
Comment 6 muthusuba 2008-05-06 11:44:52 UTC
changing issue type to patch.
Comment 7 kyoshida 2008-05-13 22:08:58 UTC
Hey Muthu,

Thanks for your work!  I tested your patch, and it works pretty well.  But one
thing I've noticed is that, when you type '=' in a cell then mouse-click on
another cell, it ends the formula mode in the first cell, and I think that's
unintended.  Can you confirm that this happens on your end as well?

Kohei
Comment 8 muthusuba 2008-05-14 11:38:32 UTC
Created attachment 53619 [details]
Updated patch
Comment 9 muthusuba 2008-05-14 11:42:37 UTC
Kohei,
  yes, i hadn't tested the simple '=' case!
i have updated the patch now...try it out...

muthusuba
Comment 10 kyoshida 2008-05-14 19:36:46 UTC
Hi Muthu,

Ok, the simple cell reference case (e.g. =A1) now works.  But entering a formula
while matching parentheses are highlighted causes the formula to be entered as
text.  :-/

For example, in a totally empty document, type '=pi()' in a cell, then while
seeing that the parens are highlighted, hit enter.  That formula is now entered
as text.  But, if you type 'pi() + 1' then hit enter, it gets entered as
formula.  I think the key is to hit enter while the paren-matching is on, then
the formula becomes text.

I'm not sure what's causing this, but can you look into this?  Thanks!

Kohei
Comment 11 kyoshida 2008-05-14 19:39:58 UTC
>if you type 'pi() + 1' then hit enter,

Sorry, typo.  I meant to say if you type '=pi() + 1' with an '='.
Comment 12 muthusuba 2008-05-19 09:24:18 UTC
kohei,
  yes, looks like the handler for 'with formating' is being called.
i have fixed, but i don;t know what else it might break.
(but, for sure, anything starting with =, +, - cannot have formatting with this
patch) We have to start with ' in case we need formatting for text starting with
=/+/-.

muthusuba
Comment 13 muthusuba 2008-05-19 09:25:30 UTC
Created attachment 53759 [details]
Updated patch.
Comment 14 kyoshida 2008-08-01 14:27:10 UTC
*** Issue 92331 has been marked as a duplicate of this issue. ***
Comment 15 niklas.nebel 2008-08-13 13:32:39 UTC
This is fixed with issue 91550.

Note that it's part of the "Enhanced Formula Input" implementation, so only the
behavior with "+" or "-" is changed, not with "=".

But if we later want to change "=" behavior, too, it should be in the new code
(ScTabViewShell::IsRefInputMode), so this patch is obsolete.

*** This issue has been marked as a duplicate of 91550 ***
Comment 16 niklas.nebel 2008-08-13 13:33:28 UTC
closing duplicate