You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2009/01/05 17:01:09 UTC

DO NOT REPLY [Bug 46479] New: [PATCH] evaluateInCell fails if the formula was previously invalid

https://issues.apache.org/bugzilla/show_bug.cgi?id=46479

           Summary: [PATCH] evaluateInCell fails if the formula was
                    previously invalid
           Product: POI
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: PatchAvailable
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: robert_longson@standardandpoors.com


Created an attachment (id=23086)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23086)
patch

a) Create a formula that is invalid e.g. put XXX in A1 and =A1+1 in B1.
b) Change the value in A1 to 2.5
c) Call HSSFFormulaEvaluator.evaluateInCell on B1

Actual Result: java.lang.IllegalStateException: Cannot get a numeric value from
a error formula cell

Expected Result: B1 contains 3.5

POI 3.1 did not have this problem but POI 3.2 and all newer versions including
the current trunk do.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 46479] [PATCH] evaluateInCell fails if the formula was previously invalid

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46479


Josh Micich <jo...@gildedtree.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #3 from Josh Micich <jo...@gildedtree.com>  2009-01-05 13:12:20 PST ---
Thanks for the patch.  There is some ambiguity in original design as to whether
setCellType() should be called before or after setCellValue().  The methods
overlap in behaviour:  setCellValue() may change the cell type, and
setCellType() converts the old cell value to the new type and sets the new
value in the cell.
The new ordering of these calls (setCellValue before setCellType) actually
causes other junits to fail, but your fix still seems correct to me.

Three other related bugs were found and fixed, and junits added for all of
them. 

svn r731715 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=731715 )

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 46479] [PATCH] evaluateInCell fails if the formula was previously invalid

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46479





--- Comment #2 from Robert Longson <ro...@standardandpoors.com>  2009-01-05 08:05:28 PST ---
Created an attachment (id=23088)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23088)
testcase


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 46479] [PATCH] evaluateInCell fails if the formula was previously invalid

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46479





--- Comment #1 from Robert Longson <ro...@standardandpoors.com>  2009-01-05 08:03:59 PST ---
Created an attachment (id=23087)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23087)
testcase


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 46479] [PATCH] evaluateInCell fails if the formula was previously invalid

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46479

--- Comment #4 from Josh Micich <jo...@gildedtree.com> 2009-12-03 14:23:52 UTC ---
Additional similar fixes applied in svn r886951

Problems occurred when changing a formula cell to type string.  These cases
weren't addressed in the previous fix.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org