[Bug 48995] Excel found unreadable content in workbook when using applyFont(...) on RichTextString

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Bug 48995] Excel found unreadable content in workbook when using applyFont(...) on RichTextString

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=48995

--- Comment #8 from Dominik Stadler <[hidden email]> ---
Updated code to produce the test-file

        try (Workbook wb = new XSSFWorkbook()) {
            Sheet sh = wb.createSheet("test");
            Row row = sh.createRow(0);
            Cell cell = row.createCell(0, CellType.STRING);

            RichTextString data = new XSSFRichTextString("bold not bold");
            Font boldFont = wb.createFont();
            boldFont.setFontName("Arial");
            boldFont.setBold(true);
            boldFont.setColor(Font.COLOR_NORMAL);
            boldFont.setFontHeightInPoints((short) 12);

            data.applyFont(0, 4, boldFont);

            cell.setCellValue(data);
            try (OutputStream stream = new FileOutputStream("/tmp/48995.xlsx"))
{
                wb.write(stream);
            }
        }

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]