poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fannin...@apache.org
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 GMT
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 <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++;
@@ -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("><v>");



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message