You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by pa...@apache.org on 2008/04/06 18:18:21 UTC

svn commit: r645257 - in /poi/branches/ooxml/src/ooxml: java/org/apache/poi/xssf/usermodel/extensions/XSSFColor.java testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java

Author: paolo
Date: Sun Apr  6 09:17:45 2008
New Revision: 645257

URL: http://svn.apache.org/viewvc?rev=645257&view=rev
Log:
TestXSSFCellStyle fixed after StylesTable initialization stuff

Modified:
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFColor.java
    poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFColor.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFColor.java?rev=645257&r1=645256&r2=645257&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFColor.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFColor.java Sun Apr  6 09:17:45 2008
@@ -25,6 +25,9 @@
 	
 	public XSSFColor(CTColor color) {
 		this.color = color;
+		if (this.color == null) {
+			this.color = CTColor.Factory.newInstance();
+		}
 	}
 	
 	public boolean isAuto() {

Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java?rev=645257&r1=645256&r2=645257&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java (original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java Sun Apr  6 09:17:45 2008
@@ -59,26 +59,28 @@
 		ctBorderA = CTBorder.Factory.newInstance();
 		XSSFCellBorder borderA = new XSSFCellBorder(ctBorderA);
 		long borderId = stylesTable.putBorder(borderA);
-		assertEquals(0, borderId);
+		assertEquals(1, borderId);
 		
 		XSSFCellBorder borderB = new XSSFCellBorder();
-		assertEquals(1, stylesTable.putBorder(borderB));
+		assertEquals(2, stylesTable.putBorder(borderB));
 		
 		ctFill = CTFill.Factory.newInstance();
 		XSSFCellFill fill = new XSSFCellFill(ctFill);
 		long fillId = stylesTable.putFill(fill);
-		assertEquals(0, fillId);
+		assertEquals(1, fillId);
 		
 		ctFont = CTFont.Factory.newInstance();
 		XSSFFont font = new XSSFFont(ctFont);
 		long fontId = stylesTable.putFont(font);
-		assertEquals(0, fontId);
+		assertEquals(1, fontId);
 		
 		cellStyleXf = ctStylesheet.addNewCellStyleXfs().addNewXf();
-		cellStyleXf.setBorderId(0);
+		cellStyleXf.setBorderId(1);
+		cellStyleXf.setFillId(1);
+		cellStyleXf.setFontId(1);
 		cellXfs = ctStylesheet.addNewCellXfs();
 		cellXf = cellXfs.addNewXf();
-		cellXf.setXfId(0);
+		cellXf.setXfId(1);
 		cellStyle = new XSSFCellStyle(cellXf, cellStyleXf, stylesTable);
 	}
 	



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