如果第一组单词未格式化,则调用richText.getFontOfFormattingRun(index) throws a NullPointerException
。这是一个Apache POI错误吗?
XSSFRichTextString rt = (XSSFRichTextString) cell.getRichStringCellValue ();
if (rt.numFormattingRuns () > 0)
{
content = "";
for (int t = 0; t < rt.numFormattingRuns (); t++)
{
if(rt.getFontOfFormattingRun (t) != null)
//handle the content based on the formatting