try to fix build issue

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1879906 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2020-07-15 21:35:35 +00:00
parent 26c2049147
commit 6508360899
1 changed files with 2 additions and 3 deletions

View File

@ -29,7 +29,6 @@ import org.apache.poi.util.XMLHelper;
import org.apache.poi.xssf.eventusermodel.XLSX2CSV; import org.apache.poi.xssf.eventusermodel.XLSX2CSV;
import org.apache.poi.xssf.eventusermodel.XSSFReader; import org.apache.poi.xssf.eventusermodel.XSSFReader;
import org.apache.poi.xssf.model.SharedStringsTable; import org.apache.poi.xssf.model.SharedStringsTable;
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
import org.xml.sax.Attributes; import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler; import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
@ -134,11 +133,11 @@ public class FromHowTo {
throws SAXException { throws SAXException {
// Process the last contents as required. // Process the last contents as required.
// Do now, as characters() may be called more than once // Do now, as characters() may be called more than once
if(nextIsString) { if(nextIsString && !lastContents.isEmpty()) {
Integer idx = Integer.valueOf(lastContents); Integer idx = Integer.valueOf(lastContents);
lastContents = lruCache.get(idx); lastContents = lruCache.get(idx);
if (lastContents == null && !lruCache.containsKey(idx)) { if (lastContents == null && !lruCache.containsKey(idx)) {
lastContents = new XSSFRichTextString(sst.getEntryAt(idx)).toString(); lastContents = sst.getItemAt(idx).toString();
lruCache.put(idx, lastContents); lruCache.put(idx, lastContents);
} }
nextIsString = false; nextIsString = false;