On Wed, 2010-11-03 at 21:47 -0700, John LeMoyne Castle wrote:
Adds '=' to edge test in sbxscan.cxx ImpCvtNum so exponent prints and 1
million is 1e+6 instead of just 1 for singles.
Same one char change does similar fix for OO Basic doubles and 1e+14.
When I saw #i76852# -- http://qa.openoffice.org/issues/show_bug.cgi?id=76852
-- describe how and when OOBasic prints as single with value 1 000 000 as 1
(with no million) I thought right off: edge case ==> missing equals.
Using OpenGrok, I drilled in through the basic interface for the CStr()
function. CStr() is implicitly called by print in the OOBasic interpreter
when it needs to print a number. Straight away found these two lines in
sbxscan.cxx ImpCvtNum method:
double dMaxNumWithoutExp = (nPrec == 6) ? 1E6 : 1E14;
myftoa( nNum, p, nPrec,( nNum &&( nNum < 1E-1 || nNum >
dMaxNumWithoutExp ) ) ? 4:0,
nice going, I see little enough risk in this other than introducing a
different error of the same type ;-) ( but it looks good to me ) The key
thing is that the internal number representation is always valid anyway
and this is a presentation bug. I think we are ok to push this to
master.
Noel
Context
- Re: [Libreoffice] [PATCH] Fix for OO Basic Million-to-one bug #i76852# · Noel Power
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.