Setting value of cell to formulas containing numbers greater than Short.MAX_VALUE (Java) caused an exception. This was due to a bug in the FormulaParser class. The code had a TODO comment saying something to the effect that numbers greater than Short.MAX_VALUE would cause a problem. The patch modifies the code so that a check is made to see if the number is larger than Short.MAX_VALUE and accordingly either IntPtg or NumberPtg is used in FormulaParser. The patch also includes an additional test case (method added to class TestFormulaParser that checks the behaviour of HSSF for large values in cell formulas).
Created attachment 14163 [details] [PATCH] Patch file for bug 33160 Patch for 33160. See previous comment for details.
This patch seems to be the same as the one attached to bug 33160. Amol, is this what you intened? Pls Clarify!
(In reply to comment #2) > This patch seems to be the same as the one attached to bug 33160. Amol, is this > what you intened? Pls Clarify! Apologize for the confusion. I attached the patch to the bug 33160 prior to attaching here, but later I came across some patch submission FAQ that said patches should be filed and submitted as a separate entry in bugzilla. Hence the duplication of this patch. The patch is IDENTICAL to the one submitted for 33160.
I am sorry if the documentation confused you... If a bug is already open, the patch is best attached to the same bug. But no probs. Btw, I dont see a test method in the patch? The patch only contains a diff for FormulaParser..?
Created attachment 14773 [details] Patch updated with test case This patch code is similar to the earlier, with one update but it also has the test case.
Thanks for the tests. applied. Slighly different fix checked in (using intptg for small numbers and numberptg for larger numbers). *** This bug has been marked as a duplicate of 33160 ***