Summary: | NullPointerException by XSSFRichTextString.getFontAtIndex | ||
---|---|---|---|
Product: | POI | Reporter: | Florian Lindermaier <florian.lindermaier> |
Component: | XSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jmarkmurph |
Priority: | P2 | ||
Version: | 3.12-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | Sample Project To Show the bug |
I put in a simple fix via r1701382, you can verify the changes with a recent nightly build or the upcoming 3.13-beta2. |
Created attachment 33058 [details] Sample Project To Show the bug Hello, i need to find striked out Characters in a Cell. In my Cell is a String containing "320 338 350". " 388" is striked out and has a blue color. My code breaks when trying to retriev the Font(richText.getFontAtIndex(i)) with i==2. At i==2 the Font changes from a the rich text font(getFontAtIndex is returning a Font) to the cell font(getFontAtIndex should return null). for (int i = richText.length() - 1; i >= 0; i--) { Font f = richText.getFontAtIndex(i); if (f != null && f.getStrikeout()) { tmpCellContent.deleteCharAt(i); } } I attached a sample project. Run the unit test