You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2008/09/13 16:00:53 UTC

svn commit: r694949 - in /poi/branches/ooxml/src: documentation/content/xdocs/changes.xml documentation/content/xdocs/spreadsheet/how-to.xml documentation/content/xdocs/status.xml examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java

Author: nick
Date: Sat Sep 13 07:00:53 2008
New Revision: 694949

URL: http://svn.apache.org/viewvc?rev=694949&view=rev
Log:
Fix from bug #45676 - Handle very long cells in the XSSF EventUserModel example

Modified:
    poi/branches/ooxml/src/documentation/content/xdocs/changes.xml
    poi/branches/ooxml/src/documentation/content/xdocs/spreadsheet/how-to.xml
    poi/branches/ooxml/src/documentation/content/xdocs/status.xml
    poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java

Modified: poi/branches/ooxml/src/documentation/content/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/documentation/content/xdocs/changes.xml?rev=694949&r1=694948&r2=694949&view=diff
==============================================================================
--- poi/branches/ooxml/src/documentation/content/xdocs/changes.xml (original)
+++ poi/branches/ooxml/src/documentation/content/xdocs/changes.xml Sat Sep 13 07:00:53 2008
@@ -41,6 +41,7 @@
         </release>
 -->
         <release version="3.5.1-beta2" date="2008-08-20">
+           <action dev="POI-DEVELOPERS" type="fix">45676 - Handle very long cells in the XSSF EventUserModel example</action>
            <action dev="POI-DEVELOPERS" type="add">Initial ExtractorFactory support for building TextExtractors for embeded documents</action>
            <action dev="POI-DEVELOPERS" type="add">Support stripping XSSF header and footer fields (eg page number) out of header and footer text if required</action>
            <action dev="POI-DEVELOPERS" type="add">Add POIXMLPropertiesTextExtractor, which provides to the OOXML file formats a similar function to HPSF's HPSFPropertiesExtractor</action>

Modified: poi/branches/ooxml/src/documentation/content/xdocs/spreadsheet/how-to.xml
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/documentation/content/xdocs/spreadsheet/how-to.xml?rev=694949&r1=694948&r2=694949&view=diff
==============================================================================
--- poi/branches/ooxml/src/documentation/content/xdocs/spreadsheet/how-to.xml (original)
+++ poi/branches/ooxml/src/documentation/content/xdocs/spreadsheet/how-to.xml Sat Sep 13 07:00:53 2008
@@ -587,10 +587,19 @@
 					nextIsString = false;
 				}
 			}
+			// Clear contents cache
+			lastContents = "";
 		}
 		
 		public void endElement(String uri, String localName, String name)
 				throws SAXException {
+			// Process the last contents as required.
+			// Do now, as characters() may be called more than once
+			if(nextIsString) {
+				int idx = Integer.parseInt(lastContents);
+				lastContents = sst.getSharedStringAt(idx);
+			}
+
 			// v => contents of a cell
 			// Output after we've seen the string contents
 			if(name.equals("v")) {
@@ -600,11 +609,7 @@
 
 		public void characters(char[] ch, int start, int length)
 				throws SAXException {
-			lastContents = new String(ch, start, length);
-			if(nextIsString) {
-				int idx = Integer.parseInt(lastContents);
-				lastContents = sst.getSharedStringAt(idx);
-			}
+			lastContents += new String(ch, start, length);
 		}
 	}
 	

Modified: poi/branches/ooxml/src/documentation/content/xdocs/status.xml
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/documentation/content/xdocs/status.xml?rev=694949&r1=694948&r2=694949&view=diff
==============================================================================
--- poi/branches/ooxml/src/documentation/content/xdocs/status.xml (original)
+++ poi/branches/ooxml/src/documentation/content/xdocs/status.xml Sat Sep 13 07:00:53 2008
@@ -38,6 +38,7 @@
         </release>
 -->
         <release version="3.5.1-beta2" date="2008-08-20">
+           <action dev="POI-DEVELOPERS" type="fix">45676 - Handle very long cells in the XSSF EventUserModel example</action>
            <action dev="POI-DEVELOPERS" type="add">Initial ExtractorFactory support for building TextExtractors for embeded documents</action>
            <action dev="POI-DEVELOPERS" type="add">Support stripping XSSF header and footer fields (eg page number) out of header and footer text if required</action>
            <action dev="POI-DEVELOPERS" type="add">Add POIXMLPropertiesTextExtractor, which provides to the OOXML file formats a similar function to HPSF's HPSFPropertiesExtractor</action>

Modified: poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java?rev=694949&r1=694948&r2=694949&view=diff
==============================================================================
--- poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java (original)
+++ poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/eventusermodel/examples/FromHowTo.java Sat Sep 13 07:00:53 2008
@@ -103,10 +103,19 @@
 					nextIsString = false;
 				}
 			}
+			// Clear contents cache
+			lastContents = "";
 		}
 		
 		public void endElement(String uri, String localName, String name)
 				throws SAXException {
+			// Process the last contents as required.
+			// Do now, as characters() may be called more than once
+			if(nextIsString) {
+				int idx = Integer.parseInt(lastContents);
+				lastContents = sst.getSharedStringAt(idx);
+			}
+
 			// v => contents of a cell
 			// Output after we've seen the string contents
 			if(name.equals("v")) {
@@ -116,11 +125,7 @@
 
 		public void characters(char[] ch, int start, int length)
 				throws SAXException {
-			lastContents = new String(ch, start, length);
-			if(nextIsString) {
-				int idx = Integer.parseInt(lastContents);
-				lastContents = sst.getSharedStringAt(idx);
-			}
+			lastContents += new String(ch, start, length);
 		}
 	}
 	



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