Bug 127599 - big number are always displayed as -2^31
Summary: big number are always displayed as -2^31
Status: RESOLVED FIXED
Alias: None
Product: calligrasheets
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Laurent Montel
URL:
Keywords:
: 72890 131163 135812 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-18 19:05 UTC by meyerm
Modified: 2008-11-15 15:48 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot of bug (97.74 KB, image/png)
2007-12-07 20:59 UTC, Marvin Hankley
Details

Note You need to log in before you can comment on or make changes to this bug.
Description meyerm 2006-05-18 19:05:08 UTC
Version:           1.5.0 (using KDE 3.5.2, Gentoo)
Compiler:          gcc version 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)
OS:                Linux (i686) release 2.6.16-gentoo-r4

Whenever I enter some number bigger than (2^31)-1 it is displayed as -2^31. This happens on x86-32 and ppc32.
Comment 1 Stefan Nikolaus 2006-05-18 19:22:47 UTC
Already fixed for 1.5.1.
Comment 2 meyerm 2006-06-04 15:50:56 UTC
I can not confirm that. :-(

I have just upgraded to KDE 3.5.3 and KOffice 1.5.1 and get similar results. In fact it is possible to enter numbers slightly bigger than (2^31)-1. But not very far. F.ex. 3000000000 still show the negative number. Results from formulars can be bigger than that. But manually inputed fields are shown wrong.

Am I doing sth. wrong or is this bug perhaps not yet solved? Thank you.
Comment 3 meyerm 2006-06-10 15:00:52 UTC
Can anybody confirm this problem?
Comment 4 Stefan Nikolaus 2006-06-10 15:15:03 UTC
The issue fixed in 1.5.1 was a similar one. My bad. You're right, this is a valid problem.
Comment 5 Sebastian Sauer 2006-08-19 12:23:18 UTC
*** Bug 131163 has been marked as a duplicate of this bug. ***
Comment 6 Sebastian Sauer 2006-08-19 18:21:22 UTC
*** Bug 72890 has been marked as a duplicate of this bug. ***
Comment 7 Stefan Nikolaus 2006-10-17 15:40:47 UTC
*** Bug 135812 has been marked as a duplicate of this bug. ***
Comment 8 Thomas Fischer 2007-01-29 13:44:00 UTC
I can confirm, that this bug still exists in KSpread 1.6.1. Here, large numbers are shown as -2^31 in the grid widget, but correctly in the line edit below the toolbars.

As far as I can see, it happens both if you enter a large number or load a CSV file containing cells with large numbers. Therefore, bug 137569 is most likely a duplicate.
Comment 9 Stefan Nikolaus 2007-01-31 12:00:35 UTC
SVN commit 628769 by nikolaus:

Formula	Use 'long' in all integer related places.
CCBUG: 127599


 M  +2 -2      formula.cc  
 M  +1 -1      formula.h  
 M  +2 -2      kspread_value.cc  


--- branches/koffice/1.6/koffice/kspread/formula.cc #628768:628769
@@ -240,9 +240,9 @@
   // FIXME check also for i18n version
 }
 
-int Token::asInteger() const
+long Token::asInteger() const
 {
-  if( isInteger() ) return m_text.toInt();
+  if( isInteger() ) return m_text.toLong();
   else return 0;
 }
 
--- branches/koffice/1.6/koffice/kspread/formula.h #628768:628769
@@ -159,7 +159,7 @@
      * Returns integer value for an integer token.
      * For any other type of token, returns 0.
      */
-    int asInteger() const;
+    long asInteger() const;
 
     /**
      * Returns floating-point value for a floating-point token.
--- branches/koffice/1.6/koffice/kspread/kspread_value.cc #628768:628769
@@ -478,7 +478,7 @@
     result = d->i;
 
   if( type() == Value::Float )
-    result = static_cast<int>(d->f);
+    result = static_cast<long>(d->f);
 
   return result;
 }
@@ -853,7 +853,7 @@
   if( ( t1 == Integer ) && ( t2 == Integer ) )
   {
     long p = asInteger();
-    long q = v.asInteger();   
+    long q = v.asInteger();
     return ( p == q ) ? 0 : ( p < q ) ? -1 : 1;
   }  
   
Comment 10 Tais P. Hansen 2007-04-19 11:15:58 UTC
This is still an issue in 1.6.2.
Comment 11 Théophile Helleboid 2007-06-24 14:38:56 UTC
still exists in Kspread 1.6.2
Comment 12 Marvin Hankley 2007-08-10 12:17:08 UTC
Problem still occurs in KSpread 1.6.3
Comment 13 Marvin Hankley 2007-12-07 20:55:22 UTC
Problem still occurs in KSpread 2.0-alpha-5 (KDE 4.0 Beta 4).
Comment 14 Marvin Hankley 2007-12-07 20:59:20 UTC
Created attachment 22405 [details]
Screenshot of bug

Screenshot of the bug taken with KSpread 2.0 alpha 5 - note different values
between formula bar and cell itself.
Comment 15 Tomas Mecir 2008-11-15 15:48:24 UTC
This is fixed now.