You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by jo...@apache.org on 2008/09/03 19:03:02 UTC

svn commit: r691687 - /poi/trunk/src/java/org/apache/poi/hssf/record/formula/ArrayPtg.java

Author: josh
Date: Wed Sep  3 10:03:02 2008
New Revision: 691687

URL: http://svn.apache.org/viewvc?rev=691687&view=rev
Log:
Fixed ArrayPtg.toString to not crash when partially initialised

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/record/formula/ArrayPtg.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/formula/ArrayPtg.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/ArrayPtg.java?rev=691687&r1=691686&r2=691687&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/ArrayPtg.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/formula/ArrayPtg.java Wed Sep  3 10:03:02 2008
@@ -94,10 +94,14 @@
 
 		buffer.append("columns = ").append(getColumnCount()).append("\n");
 		buffer.append("rows = ").append(getRowCount()).append("\n");
-		for (int x=0;x<getColumnCount();x++) {
-			for (int y=0;y<getRowCount();y++) {
-				Object o = token_3_arrayValues[getValueIndex(x, y)];
-	   			buffer.append("[").append(x).append("][").append(y).append("] = ").append(o).append("\n"); 
+		if (token_3_arrayValues == null) {
+			buffer.append("  #values#uninitialised#\n");
+		} else {
+			for (int x=0;x<getColumnCount();x++) {
+				for (int y=0;y<getRowCount();y++) {
+					Object o = token_3_arrayValues[getValueIndex(x, y)];
+					buffer.append("[").append(x).append("][").append(y).append("] = ").append(o).append("\n"); 
+				}
 			}
 		}
 		return buffer.toString();



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