* @return index the index of added entry
* @deprecated use <code>addSharedStringItem(RichTextString string)</code> instead
*/
- @Removal(version = "4.2")
+ @Removal(version = "4.2") //make private in 4.2
public int addEntry(CTRst st) {
String s = getKey(st);
count++;
@Override
protected void commit() throws IOException {
PackagePart part = getPackagePart();
- OutputStream out = part.getOutputStream();
- writeTo(out);
- out.close();
+ try (OutputStream out = part.getOutputStream()) {
+ writeTo(out);
+ }
}
}
case STRING: {
if (_sharedStringSource != null) {
XSSFRichTextString rt = new XSSFRichTextString(cell.getStringCellValue());
- int sRef = _sharedStringSource.addEntry(rt.getCTRst());
+ int sRef = _sharedStringSource.addSharedStringItem(rt);
writeAttribute("t", STCellType.S.toString());
_out.write("><v>");