View | Details | Raw Unified | Return to bug 60025
Collapse All | Expand All

(-)src/java/org/apache/poi/ss/usermodel/DataFormatter.java (-1 / +1 lines)
Lines 895-901 Link Here
895
                return cell.getRichStringCellValue().getString();
895
                return cell.getRichStringCellValue().getString();
896
896
897
            case BOOLEAN :
897
            case BOOLEAN :
898
                return String.valueOf(cell.getBooleanCellValue());
898
                return cell.getBooleanCellValue() ? "TRUE" : "FALSE";
899
            case BLANK :
899
            case BLANK :
900
                return "";
900
                return "";
901
            case ERROR:
901
            case ERROR:
(-)src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java (+21 lines)
Lines 597-602 Link Here
597
        }
597
        }
598
    }
598
    }
599
599
600
    @Test
601
    public void testBoolean() throws IOException {
602
        DataFormatter formatter = new DataFormatter();
603
604
        // Create a spreadsheet with some TRUE/FALSE boolean values in it
605
        Workbook wb = new HSSFWorkbook();
606
        try {
607
            Sheet s = wb.createSheet();
608
            Row r = s.createRow(0);
609
            Cell c = r.createCell(0);
610
611
            c.setCellValue(true);
612
            assertEquals("TRUE", formatter.formatCellValue(c));
613
614
            c.setCellValue(false);
615
            assertEquals("FALSE", formatter.formatCellValue(c));
616
        } finally {
617
            wb.close();
618
        }
619
    }
620
600
    /**
621
    /**
601
     * While we don't currently support using a locale code at
622
     * While we don't currently support using a locale code at
602
     *  the start of a format string to format it differently, we
623
     *  the start of a format string to format it differently, we

Return to bug 60025