Bug 98455 - Correctly support decimal separators even on broken keyboard layouts
Summary: Correctly support decimal separators even on broken keyboard layouts
Status: RESOLVED FIXED
Alias: None
Product: calligrasheets
Classification: Applications
Component: general (show other bugs)
Version: 1.3.5
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Laurent Montel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-02 23:46 UTC by jose lucero
Modified: 2006-04-17 17:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jose lucero 2005-02-02 23:46:28 UTC
Version:           1.3.5 (using KDE KDE 3.3.2)
Installed from:    Gentoo Packages
OS:                Linux

If my locale indicates "," as decimal separator I canot use de numerical keypad because when I press de "." it prints a period instead of a comma. In excel and openoffice the period in de numpad prints a comma or period according to the locale
Comment 1 jose lucero 2005-02-04 20:10:56 UTC
mistake, seems to work now
Comment 2 jose lucero 2005-02-04 20:22:19 UTC
The numerical period works correctly when entering stand alone numbers in cells, however when entering a formula the numpad, it prints a period no matter what the decimal separator is. If as in my case the decimal separator is a comma any formula typed with decimal numbers using the numpad results in a parse error since the numbers are not entered with commas as decimal separator , but with periods that kspread does not understand.
Comment 3 Tomas Mecir 2005-02-24 16:36:24 UTC
Hm, is this really an issue ?
I have "," as separator in locale as well, and I don't have problems like this because the numpad types ",", not "." - of course, when I have my local keyboard layout, not english layout.

So, can't you simply use your locale's kb layout, not an english one ?
Comment 4 jose lucero 2005-02-24 16:47:13 UTC
I have a spanish keyboard and using es_Ar locale, so it is an issue , furthermore if i type a number in a cell kspread correctly prints a comma while if i type within a formula it prints a dot, unlike other soft (for example excel) that correctly prints a comma or period according to the locale
Comment 5 Tomas Mecir 2005-03-08 09:58:17 UTC
Hmmm... Do I understand it correctly that your keyboard types a dot, then KSpread converts it to a comma after pressing enter ?
If so, then this is not about numpad period, but about the formula parser not using the correct locale settings, am I right ?
Comment 6 jose lucero 2005-03-08 20:53:18 UTC
Thats pretty much the issue Kspread always prints a period on the formula bar when using numpad, after pressing enter kspread correctly changes the dot to a comma when i entered only a number, but if i have entered a formula kspread leaves the period causing an error in the cell.

As a comparison Excel gets it always right, it always prints a comma if that is the decimal separator (it shows a comma from the start in the formula bar)
OOCalc 1.1.4 gets it wrong always (prints a period regardless of locale setting making the numpad pretty much useless for numerical input if locale has a comma as decimal separator)
 
Comment 7 Tomas Mecir 2005-03-09 08:19:50 UTC
CVS commit by mecir: 

The new parser now supports numbers with '.' as a decimal separator,
not just ones with the localized separator.
That means, if your decimal separator is a comma, the new parser
will recognize both 1.23 and 1,23 as numbers.

IMPORTANT: I'm talking about the *new* parser here - the one, which will
only be used AFTER 1.4 - hence this problem will still persist in 1.4,
unless I find a way how to fix this in koscript.

CCBUG: 98455


  M +3 -2      formula.cc   1.20


--- koffice/kspread/formula.cc  #1.19:1.20
@@ -690,6 +690,7 @@ Tokens Formula::scan( const QString& exp
        else if( !thousand.isEmpty() && ( ch ==thousand[0] ) ) i++;
 
-       // convert decimal separator to '.'
-       else if( !decimal.isEmpty() && ( ch == decimal[0] ) )
+       // convert decimal separator to '.', also support '.' directly
+       // we always support '.' because of bug #98455
+       else if(( !decimal.isEmpty() && ( ch == decimal[0] ) ) || (ch == '.'))
        {
          tokenText.append( '.' );


Comment 8 Tomas Mecir 2005-03-09 08:25:47 UTC
Renaming the bug a bit ...

For the reference, old summary was:
the numpad period should be localized to print "." or "," according to decimal separator of locale

Strictly speaking, this might not really be considered a bug in KSpread, but more like a bug in the keyboard layout - if you have ',' as a decimal separator, then the keyboard layout should be configured to use ',' when pressing the numpad. key, not '.' .

But in my opinion, this bug is still valid, as otherwise, we'd have problems with documents created with different locale - actually, we'll still have them, but that's another (and more complicated) story. ;)
Comment 9 Jo Øiongen 2006-04-17 15:13:22 UTC
OK. Kspread 1.5 is out and I can not recreate this bug with my Norwegian keyboard. (Uses "," as decimal separator.) Anyone object to marking this mug as "FIXED"?

Cheers Jo
Comment 10 Tomas Mecir 2006-04-17 17:11:52 UTC
*** Bug has been marked as fixed ***.