ASF Bugzilla – Attachment 34165 Details for
Bug 60025
[PATCH] DataFormatter should return TRUE or FALSE for boolean cell values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Unit test and DataFormatter fix
bug60025.patch (text/plain), 1.71 KB, created by
Javen O'Neal
on 2016-08-20 05:39:50 UTC
(
hide
)
Description:
Unit test and DataFormatter fix
Filename:
MIME Type:
Creator:
Javen O'Neal
Created:
2016-08-20 05:39:50 UTC
Size:
1.71 KB
patch
obsolete
>Index: src/java/org/apache/poi/ss/usermodel/DataFormatter.java >=================================================================== >--- src/java/org/apache/poi/ss/usermodel/DataFormatter.java (revision 1756983) >+++ src/java/org/apache/poi/ss/usermodel/DataFormatter.java (working copy) >@@ -895,7 +895,7 @@ > return cell.getRichStringCellValue().getString(); > > case BOOLEAN : >- return String.valueOf(cell.getBooleanCellValue()); >+ return cell.getBooleanCellValue() ? "TRUE" : "FALSE"; > case BLANK : > return ""; > case ERROR: >Index: src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java >=================================================================== >--- src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java (revision 1756983) >+++ src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java (working copy) >@@ -597,6 +597,27 @@ > } > } > >+ @Test >+ public void testBoolean() throws IOException { >+ DataFormatter formatter = new DataFormatter(); >+ >+ // Create a spreadsheet with some TRUE/FALSE boolean values in it >+ Workbook wb = new HSSFWorkbook(); >+ try { >+ Sheet s = wb.createSheet(); >+ Row r = s.createRow(0); >+ Cell c = r.createCell(0); >+ >+ c.setCellValue(true); >+ assertEquals("TRUE", formatter.formatCellValue(c)); >+ >+ c.setCellValue(false); >+ assertEquals("FALSE", formatter.formatCellValue(c)); >+ } finally { >+ wb.close(); >+ } >+ } >+ > /** > * While we don't currently support using a locale code at > * the start of a format string to format it differently, we
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 60025
: 34165