Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 50B98200D5F for ; Mon, 18 Dec 2017 21:54:46 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4F70A160C05; Mon, 18 Dec 2017 20:54:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 94125160BFB for ; Mon, 18 Dec 2017 21:54:45 +0100 (CET) Received: (qmail 90494 invoked by uid 500); 18 Dec 2017 20:54:44 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 90485 invoked by uid 99); 18 Dec 2017 20:54:44 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Dec 2017 20:54:44 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 8397F3A00A7 for ; Mon, 18 Dec 2017 20:54:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1818623 - in /poi/trunk/src/ooxml/java/org/apache/poi/xssf: model/SharedStringsTable.java streaming/SheetDataWriter.java Date: Mon, 18 Dec 2017 20:54:40 -0000 To: commits@poi.apache.org From: fanningpj@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20171218205443.8397F3A00A7@svn01-us-west.apache.org> archived-at: Mon, 18 Dec 2017 20:54:46 -0000 Author: fanningpj Date: Mon Dec 18 20:54:39 2017 New Revision: 1818623 URL: http://svn.apache.org/viewvc?rev=1818623&view=rev Log: use non deprecated method for adding string to shared strings table Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java?rev=1818623&r1=1818622&r2=1818623&view=diff ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java Mon Dec 18 20:54:39 2017 @@ -193,7 +193,7 @@ public class SharedStringsTable extends * @return index the index of added entry * @deprecated use addSharedStringItem(RichTextString string) instead */ - @Removal(version = "4.2") + @Removal(version = "4.2") //make private in 4.2 public int addEntry(CTRst st) { String s = getKey(st); count++; @@ -278,8 +278,8 @@ public class SharedStringsTable extends @Override protected void commit() throws IOException { PackagePart part = getPackagePart(); - OutputStream out = part.getOutputStream(); - writeTo(out); - out.close(); + try (OutputStream out = part.getOutputStream()) { + writeTo(out); + } } } Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java?rev=1818623&r1=1818622&r2=1818623&view=diff ============================================================================== --- poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java (original) +++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java Mon Dec 18 20:54:39 2017 @@ -280,7 +280,7 @@ public class SheetDataWriter implements 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(">"); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org For additional commands, e-mail: commits-help@poi.apache.org