| Summary: | big number are always displayed as -2^31 | ||
|---|---|---|---|
| Product: | [Applications] calligrasheets | Reporter: | meyerm |
| Component: | general | Assignee: | Laurent Montel <montel> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | aumuell, bugs-kde, chtitux, dietmar.frohboese, fischer, martin.hohenberg, marvin.hankley, mecirt |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Screenshot of bug | ||
|
Description
meyerm
2006-05-18 19:05:08 UTC
Already fixed for 1.5.1. 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. Can anybody confirm this problem? The issue fixed in 1.5.1 was a similar one. My bad. You're right, this is a valid problem. *** Bug 131163 has been marked as a duplicate of this bug. *** *** Bug 72890 has been marked as a duplicate of this bug. *** *** Bug 135812 has been marked as a duplicate of this bug. *** 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. 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;
}
This is still an issue in 1.6.2. still exists in Kspread 1.6.2 Problem still occurs in KSpread 1.6.3 Problem still occurs in KSpread 2.0-alpha-5 (KDE 4.0 Beta 4). 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.
This is fixed now. |