You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2018/07/25 13:09:54 UTC

svn commit: r1836627 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java

Author: fanningpj
Date: Wed Jul 25 13:09:54 2018
New Revision: 1836627

URL: http://svn.apache.org/viewvc?rev=1836627&view=rev
Log:
make ReadOnlySharedStringsTable subclassable

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java?rev=1836627&r1=1836626&r2=1836627&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java Wed Jul 25 13:09:54 2018
@@ -23,9 +23,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.PushbackInputStream;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import org.apache.poi.openxml4j.opc.OPCPackage;
 import org.apache.poi.openxml4j.opc.PackagePart;
@@ -79,19 +77,20 @@ import org.xml.sax.helpers.DefaultHandle
  */
 public class ReadOnlySharedStringsTable extends DefaultHandler {
 
-    private final boolean includePhoneticRuns;
+    protected final boolean includePhoneticRuns;
+
     /**
      * An integer representing the total count of strings in the workbook. This count does not
      * include any numbers, it counts only the total of text strings in the workbook.
      */
-    private int count;
+    protected int count;
 
     /**
      * An integer representing the total count of unique strings in the Shared String Table.
      * A string is unique even if it is a copy of another string, but has different formatting applied
      * at the character level.
      */
-    private int uniqueCount;
+    protected int uniqueCount;
 
     /**
      * The shared strings table.
@@ -99,12 +98,6 @@ public class ReadOnlySharedStringsTable
     private List<String> strings;
 
     /**
-     * Map of phonetic strings (if they exist) indexed
-     * with the integer matching the index in strings
-     */
-    private Map<Integer, String> phoneticStrings;
-
-    /**
      * Calls {{@link #ReadOnlySharedStringsTable(OPCPackage, boolean)}} with
      * a value of <code>true</code> for including phonetic runs
      *
@@ -240,7 +233,6 @@ public class ReadOnlySharedStringsTable
             if(uniqueCount != null) this.uniqueCount = Integer.parseInt(uniqueCount);
 
             this.strings = new ArrayList<>(this.uniqueCount);
-            this.phoneticStrings = new HashMap<>();
             characters = new StringBuilder(64);
         } else if ("si".equals(localName)) {
             characters.setLength(0);
@@ -255,8 +247,7 @@ public class ReadOnlySharedStringsTable
         }
     }
 
-    public void endElement(String uri, String localName, String name)
-            throws SAXException {
+    public void endElement(String uri, String localName, String name) throws SAXException {
         if (uri != null && ! uri.equals(NS_SPREADSHEETML)) {
             return;
         }
@@ -273,8 +264,7 @@ public class ReadOnlySharedStringsTable
     /**
      * Captures characters only if a t(ext) element is open.
      */
-    public void characters(char[] ch, int start, int length)
-            throws SAXException {
+    public void characters(char[] ch, int start, int length) throws SAXException {
         if (tIsOpen) {
             if (inRPh && includePhoneticRuns) {
                 characters.append(ch, start, length);



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