You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ye...@apache.org on 2008/10/19 14:54:42 UTC

svn commit: r706003 [1/2] - in /poi/branches/ooxml/src/ooxml: interfaces-jdk15/org/apache/poi/ss/usermodel/ java/org/apache/poi/ java/org/apache/poi/xssf/eventusermodel/ java/org/apache/poi/xssf/model/ java/org/apache/poi/xssf/usermodel/ testcases/org/...

Author: yegor
Date: Sun Oct 19 05:54:40 2008
New Revision: 706003

URL: http://svn.apache.org/viewvc?rev=706003&view=rev
Log:
more code cleanup and refactoring: (a) removed references to ooxml schemas from XSSF enums, they should not depend on ooxml-schemas.jar
(b) removed "for testing only" constructors, the goal is to have a single, maximum 2 constructors for objects inherited from POIXMLDocumentPart
(c) more javadocs 

Modified:
    poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Row.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/CommentsTable.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/BorderStyle.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FillPatternType.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontCharset.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontFamily.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontScheme.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontUnderline.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/IndexedColors.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PageOrder.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PaperSize.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintCellComments.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintOrientation.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDialogsheet.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPrintSetup.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
    poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java
    poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestCommentsTable.java
    poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestSharedStringsTable.java
    poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestStylesTable.java
    poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCell.java
    poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFComment.java
    poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDialogSheet.java
    poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPrintSetup.java
    poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFRow.java
    poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java
    poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/helpers/TestColumnHelper.java

Modified: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Row.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Row.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Row.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Row.java Sun Oct 19 05:54:40 2008
@@ -41,18 +41,6 @@
      * Use this to create new cells within the row and return it.
      * <p>
      * The cell that is returned is a CELL_TYPE_BLANK. The type can be changed
-     * either through calling <code>setCellValue</code> or <code>setCellType</code>.
-     *
-     * @param column - the column number this cell represents
-     *
-     * @return Cell a high level representation of the created cell.
-     */
-    Cell createCell(short column);
-
-    /**
-     * Use this to create new cells within the row and return it.
-     * <p>
-     * The cell that is returned is a CELL_TYPE_BLANK. The type can be changed
      * either through calling setCellValue or setCellType.
      *
      * @param column - the column number this cell represents

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java Sun Oct 19 05:54:40 2008
@@ -176,6 +176,7 @@
             doc.packageRel = rel;
             doc.packagePart = part;
             doc.parent = this;
+            doc.onDocumentCreate();
             addRelation(doc);
             return doc;
         } catch (Exception e){
@@ -201,6 +202,7 @@
                 }
                 POIXMLDocumentPart childPart = factory.createDocumentPart(rel, p);
                 childPart.parent = this;
+                childPart.onDocumentRead();
                 addRelation(childPart);
 
                 if(p.hasRelationships()) childPart.read(factory);
@@ -208,4 +210,17 @@
         }
     }
 
+    /**
+     * Fired when a new package part is created
+     */
+    public void onDocumentCreate(){
+
+    }
+
+    /**
+     * Fired when a package part is read
+     */
+    public void onDocumentRead(){
+
+    }
 }

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java Sun Oct 19 05:54:40 2008
@@ -68,7 +68,8 @@
      *  shared strings.
      */
     public SharedStringsTable getSharedStringsTable() throws IOException, InvalidFormatException {
-        return new SharedStringsTable(getSharedStringsData());
+        ArrayList<PackagePart> parts = pkg.getPartsByContentType( XSSFRelation.SHARED_STRINGS.getContentType());
+        return parts.size() == 0 ? null : new SharedStringsTable(parts.get(0), null);
     }
 
     /**
@@ -76,7 +77,8 @@
      *  returns a handy object for working with cell styles
      */
     public StylesTable getStylesTable() throws IOException, InvalidFormatException {
-        return new StylesTable(getStylesData());
+        ArrayList<PackagePart> parts = pkg.getPartsByContentType( XSSFRelation.STYLES.getContentType());
+        return parts.size() == 0 ? null : new StylesTable(parts.get(0), null);
     }
 
 

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/CommentsTable.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/CommentsTable.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/CommentsTable.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/CommentsTable.java Sun Oct 19 05:54:40 2008
@@ -35,23 +35,12 @@
 import org.openxml4j.opc.PackageRelationship;
 
 public class CommentsTable extends POIXMLDocumentPart implements CommentsSource {
-    private CTComments comments;
+    protected CTComments comments;
 
-    public CommentsTable(InputStream is) throws IOException {
-        super(null, null);
-        readFrom(is);
-    }
     public CommentsTable() {
         super(null, null);
         comments = CTComments.Factory.newInstance();
     }
-    /**
-     * For unit testing only!
-     */
-    public CommentsTable(CTComments comments) {
-        super(null, null);
-        this.comments = comments;
-    }
 
     public CommentsTable(PackagePart part, PackageRelationship rel) throws IOException {
         super(part, rel);
@@ -148,4 +137,8 @@
         getCommentsAuthors().insertAuthor(index, author);
         return index;
     }
+
+    public CTComments getCTComments(){
+        return comments;
+    }
 }
\ No newline at end of file

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/SharedStringsTable.java Sun Oct 19 05:54:40 2008
@@ -60,7 +60,7 @@
  * @author Nick Birch
  * @author Yegor Kozlov
  */
-public class SharedStringsTable extends POIXMLDocumentPart implements SharedStringSource {
+public class SharedStringsTable extends POIXMLDocumentPart {
 
     /**
      *  Array of individual string items in the Shared String table.
@@ -85,18 +85,6 @@
      */
     private int uniqueCount;
 
-    /**
-     * Create a new SharedStringsTable, by reading it 
-     *  from the InputStream of a PackagePart.
-     * 
-     * @param is The input stream containing the XML document.
-     * @throws IOException if an error occurs while reading.
-     */
-    public SharedStringsTable(InputStream is) throws IOException {
-        super(null, null);
-        readFrom(is);
-    }
-
     public SharedStringsTable() {
         super(null, null);
     }

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java Sun Oct 19 05:54:40 2008
@@ -82,17 +82,6 @@
 	private StyleSheetDocument doc;
 
 	/**
-	 * Create a new StylesTable, by reading it from
-	 *  the InputStream of a a PackagePart.
-	 *
-	 * @param is The input stream containing the XML document.
-	 * @throws IOException if an error occurs while reading.
-	 */
-	public StylesTable(InputStream is) throws IOException {
-        super(null, null);
-		readFrom(is);
-	}
-	/**
 	 * Create a new, empty StylesTable
 	 */
 	public StylesTable() {

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/BorderStyle.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/BorderStyle.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/BorderStyle.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/BorderStyle.java Sun Oct 19 05:54:40 2008
@@ -22,9 +22,7 @@
  * i.e., whether it is borded dash dot, dash dot dot, dashed, dotted, double, hair, medium, 
  * medium dash dot, medium dash dot dot, medium dashed, none, slant dash dot, thick or thin.
  */
-
-
-public enum BorderStyle {
+ public enum BorderStyle {
 
     /**
      * No border

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FillPatternType.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FillPatternType.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FillPatternType.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FillPatternType.java Sun Oct 19 05:54:40 2008
@@ -21,8 +21,6 @@
  * The enumeration value indicating the style of fill pattern being used for a cell format.
  * 
  */
-
-
 public enum FillPatternType {
     
     /**  No background */

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontCharset.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontCharset.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontCharset.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontCharset.java Sun Oct 19 05:54:40 2008
@@ -23,7 +23,6 @@
  * corresponds to the ANSI codepage (8-bit or DBCS) of that character set used by a given language. 
  * 
  * @author Gisella Bronzetti
- *
  */
 public enum FontCharset {
 
@@ -33,7 +32,6 @@
      MAC(77),
      SHIFTJIS(128),
      HANGEUL(129),
-     HANGUL(129),
      JOHAB(130),
      GB2312(134),
      CHINESEBIG5(136),
@@ -51,62 +49,27 @@
     
     private int charset;
 
-    
-    FontCharset(int value){
+    private FontCharset(int value){
         charset = value;
     }
 
     /**
-     * Returns index of this charset
+     * Returns value of this charset
      *
-     * @return index of this charset
+     * @return value of this charset
      */
-    public byte getValue(){
-        return (byte)charset;
+    public int getValue(){
+        return charset;
     }
-    
+
+    private static FontCharset[] _table = new FontCharset[256];
+    static {
+        for (FontCharset c : values()) {
+            _table[c.getValue()] = c;
+        }
+    }
+
     public static FontCharset valueOf(int value){
-	switch (value) {
-	case 0:
-	    return ANSI;
-	case 1:
-	    return DEFAULT;
-	case 2:
-	    return SYMBOL;
-	case 77:
-	    return MAC;
-	case 128:
-	    return SHIFTJIS;
-	case 129:
-	    return HANGEUL;
-	case 130:
-	    return JOHAB;
-	case 134:
-	    return GB2312;
-	case 136:
-	    return CHINESEBIG5;
-	case 161:
-	    return GREEK;
-	case 162:
-	    return TURKISH;
-	case 163:
-	    return VIETNAMESE;
-	case 177:
-	    return HEBREW;
-	case 178:
-	    return ARABIC;
-	case 186:
-	    return BALTIC;
-	case 204:
-	    return RUSSIAN;
-	case 222:
-	    return THAI;
-	case 238:
-	    return EASTEUROPE;
-	case 255:
-	    return OEM;
-	}
-	throw new RuntimeException("Charset value ["+ value +"] not supported");    
+        return _table[value];
     }
-    
 }

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontFamily.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontFamily.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontFamily.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontFamily.java Sun Oct 19 05:54:40 2008
@@ -19,12 +19,10 @@
 
 
 /**
- * 
  * The font family this font belongs to. A font family is a set of fonts having common stroke width and serif
  * characteristics. The font name overrides when there are conflicting values.
- * 
- * @author Gisella Bronzetti
  *
+ * @author Gisella Bronzetti
  */
 public enum FontFamily {
 
@@ -34,11 +32,10 @@
     MODERN(3),
     SCRIPT(4),
     DECORATIVE(5);
-    
+
     private int family;
 
-    
-    FontFamily(int value){
+    private FontFamily(int value) {
         family = value;
     }
 
@@ -47,28 +44,19 @@
      *
      * @return index of this font family
      */
-    public int getValue(){
+    public int getValue() {
         return family;
     }
-    
 
-    public static FontFamily valueOf(int family){
-	switch (family) {
-	case 0:
-	    return NOT_APPLICABLE;
-	case 1:
-	    return ROMAN;
-	case 2:
-	    return SWISS;
-	case 3:
-	    return MODERN;
-	case 4:
-	    return SCRIPT;
-	case 5:
-	    return DECORATIVE;
-	}
-	throw new RuntimeException("Family value ["+ family +"] not supported");    
+    private static FontFamily[] _table = new FontFamily[6];
+
+    static {
+        for (FontFamily c : values()) {
+            _table[c.getValue()] = c;
+        }
+    }
+
+    public static FontFamily valueOf(int family) {
+        return _table[family];
     }
-    
-    
 }

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontScheme.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontScheme.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontScheme.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontScheme.java Sun Oct 19 05:54:40 2008
@@ -17,52 +17,41 @@
 
 package org.apache.poi.xssf.usermodel;
 
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.STFontScheme;
-
 
 /**
- * Defines the font scheme to which this font belongs. 
+ * Defines the font scheme to which this font belongs.
  * When a font definition is part of a theme definition, then the font is categorized as either a major or minor font scheme component.
  * When a new theme is chosen, every font that is part of a theme definition is updated to use the new major or minor font definition for that
  * theme.
  * Usually major fonts are used for styles like headings, and minor fonts are used for body & paragraph text.
  *
  * @author Gisella Bronzetti
- *
  */
 public enum FontScheme {
 
 
-    MAJOR(STFontScheme.MAJOR), 
-    MINOR(STFontScheme.MINOR),
-    NONE(STFontScheme.NONE);
+    NONE(1),
+    MAJOR(2),
+    MINOR(3);
 
-    private STFontScheme.Enum scheme;
+    private int value;
 
-
-    FontScheme(STFontScheme.Enum value){
-	scheme = value;
+    private FontScheme(int val) {
+        value = val;
     }
 
-    /**
-     * Returns STFontScheme.Enum value of this font scheme
-     *
-     * @return STFontScheme.Enum value of this font scheme
-     */
-    public STFontScheme.Enum getValue(){
-	return scheme;
+    public int getValue() {
+        return value;
     }
 
+    private static FontScheme[] _table = new FontScheme[4];
+    static {
+        for (FontScheme c : values()) {
+            _table[c.getValue()] = c;
+        }
+    }
 
-    public static FontScheme valueOf(STFontScheme.Enum scheme){
-	switch (scheme.intValue()) {
-	case STFontScheme.INT_MAJOR:
-	    return MAJOR;
-	case STFontScheme.INT_MINOR:
-	    return MINOR;
-	case STFontScheme.INT_NONE:
-	    return NONE;
-	}
-	throw new RuntimeException("Schema value ["+ scheme +"] not supported");    
+    public static FontScheme valueOf(int value){
+        return _table[value];
     }
 }

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontUnderline.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontUnderline.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontUnderline.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontUnderline.java Sun Oct 19 05:54:40 2008
@@ -17,59 +17,107 @@
 
 package org.apache.poi.xssf.usermodel;
 
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.STUnderlineValues;
-
+import org.apache.poi.ss.usermodel.Font;
 
 /**
  * the different types of possible underline formatting
- * 
- * @author Gisella Bronzetti
  *
+ * @author Gisella Bronzetti
  */
 public enum FontUnderline {
-    
-/**
- * Double-line underlining under each character in the
- * cell. underlines are drawn through the descenders of
- * characters such as g and p.
- */
-   DOUBLE(STUnderlineValues.DOUBLE),
-   DOUBLE_ACCOUNTING(STUnderlineValues.DOUBLE_ACCOUNTING),
-   NONE(STUnderlineValues.NONE),
-   SINGLE(STUnderlineValues.SINGLE),
-   SINGLE_ACCOUNTING(STUnderlineValues.SINGLE_ACCOUNTING);
-    
-    private STUnderlineValues.Enum underline;
-
-    
-    FontUnderline(STUnderlineValues.Enum value){
-        underline = value;
-    }
 
     /**
-     * Returns index of this font family
-     *
-     * @return index of this font family
+     * Single-line underlining under each character in the cell.
+     * The underline is drawn through the descenders of
+     * characters such as g and p..
+     */
+    SINGLE(1),
+
+    /**
+     * Double-line underlining under each character in the
+     * cell. underlines are drawn through the descenders of
+     * characters such as g and p.
+     */
+    DOUBLE(2),
+
+    /**
+     * Single-line accounting underlining under each
+     * character in the cell. The underline is drawn under the
+     * descenders of characters such as g and p.
      */
-    public STUnderlineValues.Enum getValue(){
-        return underline;
+    SINGLE_ACCOUNTING(3),
+
+    /**
+     * Double-line accounting underlining under each
+     * character in the cell. The underlines are drawn under
+     * the descenders of characters such as g and p.
+     */
+    DOUBLE_ACCOUNTING(4),
+
+    /**
+     * No underline.
+     */
+    NONE(5);
+
+    private int value;
+
+
+    private FontUnderline(int val) {
+        value = val;
+    }
+
+    public int getValue() {
+        return value;
     }
-    
-    public static FontUnderline valueOf(STUnderlineValues.Enum underline){
-	switch (underline.intValue()) {
-	case STUnderlineValues.INT_DOUBLE:
-	    return DOUBLE;
-	case STUnderlineValues.INT_DOUBLE_ACCOUNTING:
-	    return DOUBLE_ACCOUNTING;
-	case STUnderlineValues.INT_SINGLE:
-	    return SINGLE;
-	case STUnderlineValues.INT_SINGLE_ACCOUNTING:
-	    return SINGLE_ACCOUNTING;
-	case STUnderlineValues.INT_NONE:
-	    return NONE;
-	}
-	throw new RuntimeException("Underline value ["+ underline +"] not supported");    
+
+    public byte getByteValue() {
+        switch (this) {
+            case DOUBLE:
+                return Font.U_DOUBLE;
+            case DOUBLE_ACCOUNTING:
+                return Font.U_DOUBLE_ACCOUNTING;
+            case SINGLE_ACCOUNTING:
+                return Font.U_SINGLE_ACCOUNTING;
+            case NONE:
+                return Font.U_NONE;
+            case SINGLE:
+                return Font.U_SINGLE;
+            default:
+                return Font.U_SINGLE;
+        }
     }
-    
-    
+
+    private static FontUnderline[] _table = new FontUnderline[6];
+    static {
+        for (FontUnderline c : values()) {
+            _table[c.getValue()] = c;
+        }
+    }
+
+    public static FontUnderline valueOf(int value){
+        return _table[value];
+    }
+
+    public static FontUnderline valueOf(byte value){
+        FontUnderline val;
+        switch (value) {
+            case Font.U_DOUBLE:
+                val = FontUnderline.DOUBLE;
+                break;
+            case Font.U_DOUBLE_ACCOUNTING:
+                val = FontUnderline.DOUBLE_ACCOUNTING;
+                break;
+            case Font.U_SINGLE_ACCOUNTING:
+                val = FontUnderline.SINGLE_ACCOUNTING;
+                break;
+            case Font.U_SINGLE:
+                val = FontUnderline.SINGLE;
+                break;
+            default:
+                val = FontUnderline.NONE;
+                break;
+        }
+        return val;
+    }
+
 }

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/IndexedColors.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/IndexedColors.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/IndexedColors.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/IndexedColors.java Sun Oct 19 05:54:40 2008
@@ -78,8 +78,7 @@
     PLUM(61),
     INDIGO(62),
     GREY_80_PERCENT(63),
-    AUTOMATIC(64),
-    ;
+    AUTOMATIC(64);
 
     private int index;
 

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PageOrder.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PageOrder.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PageOrder.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PageOrder.java Sun Oct 19 05:54:40 2008
@@ -17,8 +17,6 @@
 
 package org.apache.poi.xssf.usermodel;
 
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.STPageOrder;
-
 /**
  * Specifies printed page order.
  *
@@ -29,37 +27,33 @@
     /**
      * Order pages vertically first, then move horizontally.
      */
-    DOWN_THEN_OVER(STPageOrder.DOWN_THEN_OVER),
+    DOWN_THEN_OVER(1),
     /**
      * Order pages horizontally first, then move vertically
      */
-    OVER_THEN_DOWN(STPageOrder.OVER_THEN_DOWN);
+    OVER_THEN_DOWN(2);
 
 
-    private STPageOrder.Enum order;
+    private int order;
 
 
-    PageOrder(STPageOrder.Enum order) {
+    private PageOrder(int order) {
         this.order = order;
     }
 
-    /**
-     * Returns value of pages order
-     *
-     * @return String value of pages order
-     */
-    public STPageOrder.Enum getValue() {
+    public int getValue() {
         return order;
     }
 
 
-    public static PageOrder valueOf(STPageOrder.Enum pageOrder) {
-        switch (pageOrder.intValue()) {
-            case STPageOrder.INT_DOWN_THEN_OVER:
-                return DOWN_THEN_OVER;
-            case STPageOrder.INT_OVER_THEN_DOWN:
-                return OVER_THEN_DOWN;
+    private static PageOrder[] _table = new PageOrder[3];
+    static {
+        for (PageOrder c : values()) {
+            _table[c.getValue()] = c;
         }
-        throw new RuntimeException("PageOrder value [" + pageOrder + "] not supported");
+    }
+
+    public static PageOrder valueOf(int value){
+        return _table[value];
     }
 }

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PaperSize.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PaperSize.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PaperSize.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PaperSize.java Sun Oct 19 05:54:40 2008
@@ -40,5 +40,4 @@
     QUARTO_PAPER,
     STANDARD_PAPER_10_14,
     STANDARD_PAPER_11_17;
-    
 }

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintCellComments.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintCellComments.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintCellComments.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintCellComments.java Sun Oct 19 05:54:40 2008
@@ -17,8 +17,6 @@
 
 package org.apache.poi.xssf.usermodel;
 
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCellComments;
-
 /**
  * These enumerations specify how cell comments shall be displayed for paper printing purposes.
  *
@@ -29,45 +27,35 @@
     /**
      * Do not print cell comments.
      */
-    NONE(STCellComments.NONE),
+    NONE(1),
     /**
      * Print cell comments as displayed.
      */
-    AS_DISPLAYED(STCellComments.AS_DISPLAYED),
+    AS_DISPLAYED(2),
     /**
      * Print cell comments at end of document.
      */
-    AT_END(STCellComments.AT_END);
-
+    AT_END(3);
 
-    private STCellComments.Enum comments;
 
+    private int comments;
 
-    PrintCellComments(STCellComments.Enum comments) {
+    private PrintCellComments(int comments) {
         this.comments = comments;
     }
 
-
-    /**
-     * Returns comments of cell
-     *
-     * @return String comments of cell
-     */
-    public STCellComments.Enum getValue() {
+    public int getValue() {
         return comments;
     }
 
-
-    public static PrintCellComments valueOf(STCellComments.Enum cellComment) {
-        switch (cellComment.intValue()) {
-            case STCellComments.INT_AS_DISPLAYED:
-                return AS_DISPLAYED;
-            case STCellComments.INT_AT_END:
-                return AT_END;
-            case STCellComments.INT_NONE:
-                return NONE;
+    private static PrintCellComments[] _table = new PrintCellComments[4];
+    static {
+        for (PrintCellComments c : values()) {
+            _table[c.getValue()] = c;
         }
-        throw new RuntimeException("PrintCellComments: value [" + cellComment + "] not supported");
     }
 
+    public static PrintCellComments valueOf(int value){
+        return _table[value];
+    }
 }

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintOrientation.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintOrientation.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintOrientation.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintOrientation.java Sun Oct 19 05:54:40 2008
@@ -17,8 +17,6 @@
 
 package org.apache.poi.xssf.usermodel;
 
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.STOrientation;
-
 /**
  * The enumeration value indicating the print orientation for a sheet.
  *
@@ -29,49 +27,37 @@
     /**
      * orientation not specified
      */
-    DEFAULT(STOrientation.DEFAULT),
+    DEFAULT(1),
     /**
      * portrait orientation
      */
-    PORTRAIT(STOrientation.PORTRAIT),
+    PORTRAIT(2),
     /**
      * landscape orientations
      */
-    LANDSCAPE(STOrientation.LANDSCAPE);
-
+    LANDSCAPE(3);
 
-    private STOrientation.Enum orientation;
 
+    private int orientation;
 
-    PrintOrientation(STOrientation.Enum orientation) {
+    private PrintOrientation(int orientation) {
         this.orientation = orientation;
     }
 
 
-    /**
-     * Returns value of the orientation
-     *
-     * @return String value of the orientation
-     */
-    public STOrientation.Enum getValue() {
+    public int getValue() {
         return orientation;
     }
 
 
-    public static PrintOrientation valueOf(STOrientation.Enum orient) {
-        switch (orient.intValue()) {
-            case STOrientation.INT_DEFAULT:
-                return DEFAULT;
-            case STOrientation.INT_LANDSCAPE:
-                return LANDSCAPE;
-            case STOrientation.INT_PORTRAIT:
-                return PORTRAIT;
-                /*
-        default:
-            return DEFAULT;
-            */
+    private static PrintOrientation[] _table = new PrintOrientation[4];
+    static {
+        for (PrintOrientation c : values()) {
+            _table[c.getValue()] = c;
         }
-        throw new RuntimeException("Orientation value [" + orient + "] not supported");
     }
 
+    public static PrintOrientation valueOf(int value){
+        return _table[value];
+    }
 }

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java Sun Oct 19 05:54:40 2008
@@ -36,6 +36,7 @@
 import org.apache.poi.util.POILogger;
 import org.apache.poi.xssf.model.SharedStringSource;
 import org.apache.poi.xssf.model.StylesTable;
+import org.apache.poi.xssf.model.SharedStringsTable;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellFormula;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCellType;
@@ -50,19 +51,11 @@
     private final CTCell cell;
     private final XSSFRow row;
     private int cellNum;
-    private SharedStringSource sharedStringSource;
+    private SharedStringsTable sharedStringSource;
     private StylesTable stylesSource;
 
     private POILogger logger = POILogFactory.getLogger(XSSFCell.class);
 
-    /**
-     * Create a new XSSFCell. This method is protected to be used only by
-     * tests.
-     */
-    protected XSSFCell(XSSFRow row) {
-        this(row, CTCell.Factory.newInstance());
-    }
-
     public XSSFCell(XSSFRow row, CTCell cell) {
         this.cell = cell;
         this.row = row;
@@ -70,10 +63,10 @@
             this.cellNum = parseCellNum(cell.getR());
         }
         this.sharedStringSource = row.getSheet().getWorkbook().getSharedStringSource();
-        this.stylesSource = (StylesTable)row.getSheet().getWorkbook().getStylesSource();
+        this.stylesSource = row.getSheet().getWorkbook().getStylesSource();
     }
 
-    protected SharedStringSource getSharedStringSource() {
+    protected SharedStringsTable getSharedStringSource() {
         return this.sharedStringSource;
     }
     

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDialogsheet.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDialogsheet.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDialogsheet.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDialogsheet.java Sun Oct 19 05:54:40 2008
@@ -19,18 +19,19 @@
 
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.xmlbeans.XmlException;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.*;
+import org.openxml4j.opc.PackagePart;
+import org.openxml4j.opc.PackageRelationship;
+
+import java.io.IOException;
 
 public class XSSFDialogsheet extends XSSFSheet implements Sheet{
 
-    public XSSFDialogsheet(CTSheet sheet, CTDialogsheet dialogsheet,
-                           XSSFWorkbook workbook) {
-        super(sheet, CTWorksheet.Factory.newInstance(), workbook);
-        this.worksheet = null;
-        this.dialogsheet = dialogsheet;
-        if (this.dialogsheet == null) {
-            this.dialogsheet = CTDialogsheet.Factory.newInstance();
-        }
+    public XSSFDialogsheet(XSSFSheet sheet) {
+        this.packagePart = sheet.getPackagePart();
+        this.packageRel = sheet.getPackageRelationship();
+        this.dialogsheet = CTDialogsheet.Factory.newInstance();
     }
 
     public XSSFRow createRow(int rowNum) {

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java Sun Oct 19 05:54:40 2008
@@ -21,17 +21,7 @@
 import org.apache.poi.ss.usermodel.Font;
 import org.apache.poi.xssf.usermodel.extensions.XSSFColor;
 import org.apache.poi.xssf.model.StylesTable;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBooleanProperty;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontName;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontScheme;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontSize;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTIntProperty;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTUnderlineProperty;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTVerticalAlignFontProperty;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.STUnderlineValues;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.STVerticalAlignRun;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.*;
 
 /**
  * Represents a font used in a workbook.
@@ -106,7 +96,8 @@
      */
     public byte getCharSet() {
         CTIntProperty charset = ctFont.sizeOfCharsetArray() == 0 ? null : ctFont.getCharsetArray(0);
-        return charset == null ? FontCharset.ANSI.getValue() : FontCharset.valueOf(charset.getVal()).getValue();
+        int val = charset == null ? FontCharset.ANSI.getValue() : FontCharset.valueOf(charset.getVal()).getValue();
+        return (byte)val;
     }
 
 
@@ -247,23 +238,8 @@
     public byte getUnderline() {
         CTUnderlineProperty underline = ctFont.sizeOfUArray() == 0 ? null : ctFont.getUArray(0);
         if (underline != null) {
-            FontUnderline fontUnderline = FontUnderline.valueOf(underline.getVal());
-            switch (fontUnderline.getValue().intValue()) {
-                case STUnderlineValues.INT_DOUBLE:
-                    return Font.U_DOUBLE;
-                case STUnderlineValues.INT_DOUBLE_ACCOUNTING:
-                    return Font.U_DOUBLE_ACCOUNTING;
-
-                case STUnderlineValues.INT_SINGLE_ACCOUNTING:
-                    return Font.U_SINGLE_ACCOUNTING;
-
-                case STUnderlineValues.INT_NONE:
-                    return Font.U_NONE;
-
-                case STUnderlineValues.INT_SINGLE:
-                default:
-                    return Font.U_SINGLE;
-            }
+            FontUnderline val = FontUnderline.valueOf(underline.getVal().intValue());
+            return val.getByteValue();
         }
         return Font.U_NONE;
     }
@@ -328,7 +304,7 @@
      * @param charSet
      */
     public void setCharSet(FontCharset charSet) {
-        setCharSet(charSet.getValue());
+        setCharSet((byte)charSet.getValue());
     }
 
     /**
@@ -490,26 +466,7 @@
      * @see FontUnderline
      */
     public void setUnderline(byte underline) {
-        if(underline == Font.U_NONE) {
-            ctFont.setUArray(null);
-        } else {
-            CTUnderlineProperty ctUnderline = ctFont.sizeOfUArray() == 0 ? ctFont.addNewU() : ctFont.getUArray(0);
-            switch (underline) {
-                case Font.U_DOUBLE:
-                    ctUnderline.setVal(FontUnderline.DOUBLE.getValue());
-                    break;
-                case Font.U_DOUBLE_ACCOUNTING:
-                    ctUnderline.setVal(FontUnderline.DOUBLE_ACCOUNTING.getValue());
-                    break;
-                case Font.U_SINGLE_ACCOUNTING:
-                    ctUnderline.setVal(FontUnderline.SINGLE_ACCOUNTING.getValue());
-                    break;
-                case Font.U_SINGLE:
-                default:
-                    ctUnderline.setVal(FontUnderline.NONE.getValue());
-                    break;
-            }
-        }
+        setUnderline(FontUnderline.valueOf(underline));
     }
 
     /**
@@ -520,8 +477,13 @@
      * @param underline - FontUnderline enum value
      */
     public void setUnderline(FontUnderline underline) {
-        CTUnderlineProperty ctUnderline = ctFont.sizeOfUArray() == 0 ? ctFont.addNewU() : ctFont.getUArray(0);
-        ctUnderline.setVal(underline.getValue());
+        if(underline == FontUnderline.NONE && ctFont.sizeOfUArray() > 0){
+            ctFont.setUArray(null);
+        } else {
+            CTUnderlineProperty ctUnderline = ctFont.sizeOfUArray() == 0 ? ctFont.addNewU() : ctFont.getUArray(0);
+            STUnderlineValues.Enum val = STUnderlineValues.Enum.forInt(underline.getValue());
+            ctUnderline.setVal(val);
+        }
     }
 
 
@@ -550,7 +512,7 @@
      */
     public FontScheme getScheme() {
         CTFontScheme scheme = ctFont.sizeOfSchemeArray() == 0 ? null : ctFont.getSchemeArray(0);
-        return scheme == null ? FontScheme.NONE : FontScheme.valueOf(scheme.getVal());
+        return scheme == null ? FontScheme.NONE : FontScheme.valueOf(scheme.getVal().intValue());
     }
 
     /**
@@ -561,7 +523,8 @@
      */
     public void setScheme(FontScheme scheme) {
         CTFontScheme ctFontScheme = ctFont.sizeOfSchemeArray() == 0 ? ctFont.addNewScheme() : ctFont.getSchemeArray(0);
-        ctFontScheme.setVal(scheme.getValue());
+        STFontScheme.Enum val = STFontScheme.Enum.forInt(scheme.getValue());
+        ctFontScheme.setVal(val);
     }
 
     /**

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPrintSetup.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPrintSetup.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPrintSetup.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPrintSetup.java Sun Oct 19 05:54:40 2008
@@ -18,9 +18,7 @@
 package org.apache.poi.xssf.usermodel;
 
 import org.apache.poi.ss.usermodel.PrintSetup;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageMargins;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPageSetup;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.*;
 
 
 /**
@@ -34,22 +32,11 @@
 
 
     public XSSFPrintSetup(CTWorksheet worksheet) {
-        if (worksheet == null) throw new NullPointerException("");
         this.ctWorksheet = worksheet;
         this.pageSetup = ctWorksheet.getPageSetup() == null ? ctWorksheet.addNewPageSetup() : ctWorksheet.getPageSetup();
         this.pageMargins = ctWorksheet.getPageMargins() == null ? ctWorksheet.addNewPageMargins() : ctWorksheet.getPageMargins();
     }
 
-    public XSSFPrintSetup(XSSFSheet sheet) {
-        this(sheet.getWorksheet());
-    }
-
-    public XSSFPrintSetup(CTPageSetup pageSetup, CTPageMargins pageMargins) {
-        this.pageMargins = pageMargins;
-        this.pageSetup = pageSetup;
-    }
-
-
     /**
      * Set the paper size.
      *
@@ -164,8 +151,9 @@
      * @param printnotes print the notes
      */
     public void setNotes(boolean printnotes) {
-        if (printnotes)
-            pageSetup.setCellComments(PrintCellComments.AS_DISPLAYED.getValue());
+        if (printnotes){
+            pageSetup.setCellComments(STCellComments.AS_DISPLAYED);
+        }
     }
 
     /**
@@ -240,7 +228,8 @@
      * @see PrintOrientation
      */
     public void setOrientation(PrintOrientation orientation) {
-        pageSetup.setOrientation(orientation.getValue());
+        STOrientation.Enum v = STOrientation.Enum.forInt(orientation.getValue());
+        pageSetup.setOrientation(v);
     }
 
     /**
@@ -250,12 +239,14 @@
      * @see PrintOrientation
      */
     public PrintOrientation getOrientation() {
-        return (pageSetup.getOrientation() == null) ? null : PrintOrientation.valueOf(pageSetup.getOrientation());
+        STOrientation.Enum val = pageSetup.getOrientation();
+        return val == null ? PrintOrientation.DEFAULT : PrintOrientation.valueOf(val.intValue());
     }
 
 
     public PrintCellComments getCellComment() {
-        return (pageSetup.getCellComments() == null) ? null : PrintCellComments.valueOf(pageSetup.getCellComments());
+        STCellComments.Enum val = pageSetup.getCellComments();
+        return val == null ? PrintCellComments.NONE : PrintCellComments.valueOf(val.intValue());
     }
 
     /**
@@ -264,7 +255,8 @@
      * @param pageOrder
      */
     public void setPageOrder(PageOrder pageOrder) {
-        pageSetup.setPageOrder(pageOrder.getValue());
+        STPageOrder.Enum v = STPageOrder.Enum.forInt(pageOrder.getValue());
+        pageSetup.setPageOrder(v);
     }
 
     /**
@@ -273,7 +265,7 @@
      * @return PageOrder
      */
     public PageOrder getPageOrder() {
-        return (pageSetup.getPageOrder() == null) ? null : PageOrder.valueOf(pageSetup.getPageOrder());
+        return (pageSetup.getPageOrder() == null) ? null : PageOrder.valueOf(pageSetup.getPageOrder().intValue());
     }
 
     /**

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java Sun Oct 19 05:54:40 2008
@@ -35,15 +35,7 @@
     private List<Cell> cells;
     
     private XSSFSheet sheet;
-    
-    /**
-     * Create a new XSSFRow. This method is protected to be used only by
-     * tests.
-     */
-    protected XSSFRow(XSSFSheet sheet) {
-        this(CTRow.Factory.newInstance(), sheet);
-    }
-    
+
     /**
      * Create a new XSSFRow.
      * 
@@ -75,29 +67,35 @@
     	return cellIterator();
     }
 
-    public int compareTo(Object obj) {
-        XSSFRow loc = (XSSFRow) obj;
-        if (this.getRowNum() == loc.getRowNum())
-        {
-            return 0;
-        }
-        if (this.getRowNum() < loc.getRowNum())
-        {
-            return -1;
-        }
-        if (this.getRowNum() > loc.getRowNum())
-        {
-            return 1;
-        }
-        return -1;
+    /**
+     * Compares two <code>XSSFRow</code> objects.
+     *
+     * @param   row   the <code>XSSFRow</code> to be compared.
+     * @return	the value <code>0</code> if the row number of this <code>XSSFRow</code> is
+     * 		equal to the row number of the argument <code>XSSFRow</code>; a value less than
+     * 		<code>0</code> if the row number of this this <code>XSSFRow</code> is numerically less
+     * 		than the row number of the argument <code>XSSFRow</code>; and a value greater
+     * 		than <code>0</code> if the row number of this this <code>XSSFRow</code> is numerically
+     * 		 greater than the row number of the argument <code>XSSFRow</code>.
+     */
+    public int compareTo(Object row) {
+        int thisVal = this.getRowNum();
+        int anotherVal = ((XSSFRow)row).getRowNum();
+        return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1));
     }
 
+    /**
+     * Use this to create new cells within the row and return it.
+     * <p>
+     * The cell that is returned is a CELL_TYPE_BLANK. The type can be changed
+     * either through calling <code>setCellValue</code> or <code>setCellType</code>.
+     *
+     * @param column - the column number this cell represents
+     * @return Cell a high level representation of the created cell.
+     */
     public XSSFCell createCell(int column) {
     	return createCell(column, Cell.CELL_TYPE_BLANK);
     }
-    public XSSFCell createCell(short column) {
-    	return createCell((int)column);
-    }
 
     /**
      * Add a new empty cell to this row.
@@ -117,19 +115,24 @@
         return xcell;
     }
 
-    public XSSFCell createCell(short column, int type) {
-    	return createCell((int)column, type);
-    }
+    /**
+     * Use this to create new cells within the row and return it.
+     *
+     * @param column - the column number this cell represents
+     * @param type - the cell's data type
+     *
+     * @return XSSFCell a high level representation of the created cell.
+     */
     public XSSFCell createCell(int column, int type) {
         int index = 0;
         for (Cell c : this.cells) {
-            if (c.getCellNum() == column) {
+            if (c.getColumnIndex() == column) {
                 // Replace c with new Cell
                 XSSFCell xcell = addCell(column, index, type);
                 cells.set(index, xcell);
                 return xcell;
             }
-            if (c.getCellNum() > column) {
+            if (c.getColumnIndex() > column) {
                 XSSFCell xcell = addCell(column, index, type);
                 cells.add(index, xcell);
                 return xcell;

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Sun Oct 19 05:54:40 2008
@@ -75,7 +75,7 @@
     protected List<Row> rows;
     protected List<XSSFHyperlink> hyperlinks;
     protected ColumnHelper columnHelper;
-    protected CommentsSource sheetComments;
+    private CommentsSource sheetComments;
     protected CTMergeCells ctMergeCells;
 
     public static final short LeftMargin = 0;
@@ -97,27 +97,6 @@
         worksheet = WorksheetDocument.Factory.parse(part.getInputStream()).getWorksheet();
     }
 
-    public XSSFSheet(CTSheet sheet, CTWorksheet worksheet, XSSFWorkbook workbook, CommentsSource sheetComments) {
-        super(null, null);
-        this.parent = workbook;
-        this.sheet = sheet;
-        this.worksheet = worksheet;
-        this.sheetComments = sheetComments;
-
-        initialize();
-    }
-
-    public XSSFSheet(CTSheet sheet, CTWorksheet worksheet, XSSFWorkbook workbook) {
-        this(sheet, worksheet, workbook, null);
-    }
-
-    protected XSSFSheet(XSSFWorkbook workbook) {
-        super(null, null);
-        this.parent = workbook;
-
-        hyperlinks = new ArrayList<XSSFHyperlink>();
-    }
-
     /**
      * Returns the parent XSSFWorkbook
      *
@@ -326,7 +305,10 @@
      *  need to assign it to a cell though
      */
     public XSSFComment createComment() {
-        return (XSSFComment)getComments().addComment();
+        if (sheetComments == null) {
+            sheetComments = (CommentsTable)createRelationship(XSSFRelation.SHEET_COMMENTS, XSSFFactory.getInstance(), (int)sheet.getSheetId());
+        }
+        return (XSSFComment)sheetComments.addComment();
     }
 
     protected XSSFRow addRow(int index, int rownum) {
@@ -394,7 +376,7 @@
 
     public XSSFComment getCellComment(int row, int column) {
         if (sheetComments == null) return null;
-        else return (XSSFComment)getComments().findCellComment(row, column);
+        else return (XSSFComment)sheetComments.findCellComment(row, column);
     }
 
     public XSSFHyperlink getHyperlink(int row, int column) {
@@ -1633,22 +1615,6 @@
         return views.getSheetViewArray(views.getSheetViewArray().length - 1);
     }
 
-    protected XSSFSheet cloneSheet() {
-        XSSFSheet newSheet = new XSSFSheet(getWorkbook());
-        newSheet.setSheet((CTSheet)sheet.copy());
-        return newSheet;
-    }
-
-    private void setSheet(CTSheet sheet) {
-        this.sheet = sheet;
-    }
-
-    private CommentsSource getComments() {
-        if (sheetComments == null) {
-            sheetComments = (CommentsTable)createRelationship(XSSFRelation.SHEET_COMMENTS, XSSFFactory.getInstance(), (int)sheet.getSheetId());
-        }
-        return sheetComments;
-    }
     /**
      * Returns the sheet's comments object if there is one,
      *  or null if not

Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java Sun Oct 19 05:54:40 2008
@@ -310,33 +310,26 @@
     public XSSFSheet cloneSheet(int sheetNum) {
         XSSFSheet srcSheet = sheets.get(sheetNum);
         String srcName = getSheetName(sheetNum);
-        if (srcSheet != null) {
-            XSSFSheet clonedSheet = srcSheet.cloneSheet();
-
-            sheets.add(clonedSheet);
-            CTSheet newcts = this.workbook.getSheets().addNewSheet();
-            newcts.set(clonedSheet.getSheet());
-
-            int i = 1;
-            while (true) {
-                //Try and find the next sheet name that is unique
-                String name = srcName;
-                String index = Integer.toString(i++);
-                if (name.length() + index.length() + 2 < 31) {
-                    name = name + "("+index+")";
-                } else {
-                    name = name.substring(0, 31 - index.length() - 2) + "(" +index + ")";
-                }
-
-                //If the sheet name is unique, then set it otherwise move on to the next number.
-                if (getSheetIndex(name) == -1) {
-                    setSheetName(sheets.size() - 1, name);
-                    break;
-                }
+        int i = 1;
+        String name = srcName;
+        while (true) {
+            //Try and find the next sheet name that is unique
+            String index = Integer.toString(i++);
+            if (name.length() + index.length() + 2 < 31) {
+                name = name + "("+index+")";
+            } else {
+                name = name.substring(0, 31 - index.length() - 2) + "(" +index + ")";
+            }
+
+            //If the sheet name is unique, then set it otherwise move on to the next number.
+            if (getSheetIndex(name) == -1) {
+                break;
             }
-            return clonedSheet;
         }
-        return null;
+
+        XSSFSheet clonedSheet = createSheet(name);
+        clonedSheet.worksheet.set(srcSheet.worksheet);
+        return clonedSheet;
     }
 
     /**
@@ -425,11 +418,9 @@
         return wrapper;
     }
 
-    protected XSSFSheet createDialogsheet(String sheetname, CTDialogsheet dialogsheet) {
-        CTSheet sheet = addSheet(sheetname);
-        XSSFDialogsheet wrapper = new XSSFDialogsheet(sheet, dialogsheet, this);
-        this.sheets.add(wrapper);
-        return wrapper;
+    protected XSSFDialogsheet createDialogsheet(String sheetname, CTDialogsheet dialogsheet) {
+        XSSFSheet sheet = createSheet(sheetname);
+        return new XSSFDialogsheet(sheet);
     }
 
     private CTSheet addSheet(String sheetname) {

Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestCommentsTable.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestCommentsTable.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestCommentsTable.java (original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestCommentsTable.java Sun Oct 19 05:54:40 2008
@@ -21,6 +21,7 @@
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
+import java.util.List;
 
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Comment;
@@ -31,13 +32,11 @@
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.apache.poi.xssf.XSSFTestDataSamples;
+import org.apache.poi.POIXMLDocumentPart;
 import org.openxml4j.opc.Package;
 import org.openxml4j.opc.PackagePart;
 import org.openxml4j.opc.PackagingURIHelper;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCommentList;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComments;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTRst;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.*;
 
 import junit.framework.TestCase;
 
@@ -48,9 +47,13 @@
 	private static final String TEST_A1_TEXT = "test A1 text";
 	private static final String TEST_AUTHOR = "test author";
 
-	public void testfindAuthor() {
-		CTComments comments = CTComments.Factory.newInstance();
-		CommentsTable sheetComments = new CommentsTable(comments);
+	public void testfindAuthor() throws Exception {
+        CommentsDocument doc = CommentsDocument.Factory.newInstance();
+		doc.setComments(CTComments.Factory.newInstance());
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        doc.save(out, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
+        CommentsTable sheetComments = new CommentsTable();
+        sheetComments.readFrom(new ByteArrayInputStream(out.toByteArray()));
 
 		assertEquals(0, sheetComments.findAuthor(TEST_AUTHOR));
 		assertEquals(1, sheetComments.findAuthor("another author"));
@@ -59,9 +62,16 @@
 		assertEquals(1, sheetComments.findAuthor("another author"));
 	}
 	
-	public void testGetCellComment() {
-		CTComments comments = CTComments.Factory.newInstance();
-		CommentsTable sheetComments = new CommentsTable(comments);
+	public void testGetCellComment() throws Exception {
+        CommentsDocument doc = CommentsDocument.Factory.newInstance();
+		doc.setComments(CTComments.Factory.newInstance());
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        doc.save(out, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
+        CommentsTable sheetComments = new CommentsTable();
+        sheetComments.readFrom(new ByteArrayInputStream(out.toByteArray()));
+
+
+		CTComments comments = sheetComments.getCTComments();
 		CTCommentList commentList = comments.addNewCommentList();
 		
 		// Create 2 comments for A1 and A" cells
@@ -85,10 +95,15 @@
 		assertNull(sheetComments.findCellComment(2, 0));
 	}
 	
-	public void testAddCellComment() {
-		CTComments comments = CTComments.Factory.newInstance();
-		CommentsTable sheetComments = new CommentsTable(comments);
-		CTCommentList commentList = comments.addNewCommentList();
+	public void testAddCellComment() throws Exception {
+        CommentsDocument doc = CommentsDocument.Factory.newInstance();
+		doc.setComments(CTComments.Factory.newInstance());
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        doc.save(out, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
+        CommentsTable sheetComments = new CommentsTable();
+        sheetComments.readFrom(new ByteArrayInputStream(out.toByteArray()));
+
+		CTCommentList commentList = sheetComments.getCTComments().addNewCommentList();
 		assertEquals(0, commentList.sizeOfCommentArray());
 		
 		XSSFComment comment = sheetComments.addComment();
@@ -114,11 +129,16 @@
 		assertTrue(xml.exists());
     	
 		Package pkg = Package.open(xml.toString());
-		PackagePart cpart = pkg.getPart(
-				PackagingURIHelper.createPartName("/xl/comments1.xml")
-		);
-		
-		CommentsTable ct = new CommentsTable(cpart.getInputStream());
+		XSSFWorkbook wb = new XSSFWorkbook(pkg);
+        List<POIXMLDocumentPart> rels = wb.getSheetAt(0).getRelations();
+        CommentsTable ct = null;
+        for(POIXMLDocumentPart p : rels) {
+            if(p instanceof CommentsTable){
+                ct = (CommentsTable)p;
+                break;
+            }
+        }
+        assertNotNull(ct);
 		assertEquals(2, ct.getNumberOfComments());
 		assertEquals(1, ct.getNumberOfAuthors());
 
@@ -126,13 +146,18 @@
 		
 		assertEquals("Nick Burch", comment.getAuthor());
 		assertEquals("Nick Burch:\nThis is a comment", comment.getString().getString());
-		
-		// Re-serialise
-		ByteArrayOutputStream baos = new ByteArrayOutputStream();
-		ct.writeTo(baos);
-		ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-		ct = new CommentsTable(bais);
-		
+
+        wb = XSSFTestDataSamples.writeOutAndReadBack(wb);
+        rels = wb.getSheetAt(0).getRelations();
+        ct = null;
+        for(POIXMLDocumentPart p : rels) {
+            if(p instanceof CommentsTable){
+                ct = (CommentsTable)p;
+                break;
+            }
+        }
+        assertNotNull(ct);
+
 		assertEquals(2, ct.getNumberOfComments());
 		assertEquals(1, ct.getNumberOfAuthors());
 		
@@ -140,9 +165,7 @@
 		
 		assertEquals("Nick Burch", comment.getAuthor());
 		
-		// TODO: Fix this!
-		// New line should still be there, but isn't!
-		//assertEquals("Nick Burch:\nThis is a comment", comment.getString().getString());
+		assertEquals("Nick Burch:\nThis is a comment", comment.getString().getString());
 	}
 
 	public void testExisting() throws Exception {

Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestSharedStringsTable.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestSharedStringsTable.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestSharedStringsTable.java (original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestSharedStringsTable.java Sun Oct 19 05:54:40 2008
@@ -111,17 +111,11 @@
 	
 	public void testReadWrite() {
         XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("sample.xlsx");
-        SharedStringsTable sst1 = (SharedStringsTable)wb.getSharedStringSource();
+        SharedStringsTable sst1 = wb.getSharedStringSource();
 
         //serialize, read back and compare with the original
-		SharedStringsTable sst2;
-		try {
-			ByteArrayOutputStream out = new ByteArrayOutputStream();
-			sst1.writeTo(out);
-			sst2 = new SharedStringsTable(new ByteArrayInputStream(out.toByteArray()));
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		}
+		SharedStringsTable sst2 = XSSFTestDataSamples.writeOutAndReadBack(wb).getSharedStringSource();
+        
         assertEquals(sst1.getCount(), sst2.getCount());
         assertEquals(sst1.getUniqueCount(), sst2.getUniqueCount());
 

Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestStylesTable.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestStylesTable.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestStylesTable.java (original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/model/TestStylesTable.java Sun Oct 19 05:54:40 2008
@@ -20,11 +20,10 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
-import java.io.IOException;
 
 import org.apache.poi.xssf.usermodel.XSSFCellStyle;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf;
+import org.apache.poi.xssf.XSSFTestDataSamples;
 
 import junit.framework.TestCase;
 
@@ -50,19 +49,17 @@
 	}
 	
 	public void testCreateSaveLoad() throws Exception {
-		StylesTable st = new StylesTable();
-		
+        XSSFWorkbook wb = new XSSFWorkbook();
+        StylesTable st = wb.getStylesSource();
+
 		assertNotNull(st._getRawStylesheet());
 		assertEquals(1, st._getXfsSize());
 		assertEquals(1, st._getStyleXfsSize());
 		assertEquals(0, st._getNumberFormatSize());
 		
-		ByteArrayOutputStream baos = new ByteArrayOutputStream();
-		st.writeTo(baos);
-		ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-		st = new StylesTable(bais);
-		
-		assertNotNull(st._getRawStylesheet());
+		st = XSSFTestDataSamples.writeOutAndReadBack(wb).getStylesSource();
+
+        assertNotNull(st._getRawStylesheet());
 		assertEquals(1, st._getXfsSize());
 		assertEquals(1, st._getStyleXfsSize());
 		assertEquals(0, st._getNumberFormatSize());
@@ -72,7 +69,7 @@
 		XSSFWorkbook workbook = new XSSFWorkbook(xml.toString());
 		assertNotNull(workbook.getStylesSource());
 		
-		StylesTable st = (StylesTable)workbook.getStylesSource();
+		StylesTable st = workbook.getStylesSource();
 		
 		doTestExisting(st);
 	}
@@ -80,13 +77,10 @@
 		XSSFWorkbook workbook = new XSSFWorkbook(xml.toString());
 		assertNotNull(workbook.getStylesSource());
 		
-		StylesTable st = (StylesTable)workbook.getStylesSource();
+		StylesTable st = workbook.getStylesSource();
 		doTestExisting(st);
 		
-		ByteArrayOutputStream baos = new ByteArrayOutputStream();
-		st.writeTo(baos);
-		ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-		st = new StylesTable(bais);
+		st = XSSFTestDataSamples.writeOutAndReadBack(workbook).getStylesSource();
 		doTestExisting(st);
 	}
 	public void doTestExisting(StylesTable st) throws Exception {
@@ -116,7 +110,8 @@
 	}
 	
 	public void testPopulateNew() throws Exception {
-		StylesTable st = new StylesTable();
+		XSSFWorkbook wb = new XSSFWorkbook();
+        StylesTable st = wb.getStylesSource();
 		
 		assertNotNull(st._getRawStylesheet());
 		assertEquals(1, st._getXfsSize());
@@ -130,11 +125,8 @@
 		st.putStyle(new XSSFCellStyle(st));
 		
 		// Save and re-load
-		ByteArrayOutputStream baos = new ByteArrayOutputStream();
-		st.writeTo(baos);
-		ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-		st = new StylesTable(bais);
-		
+		st = XSSFTestDataSamples.writeOutAndReadBack(wb).getStylesSource();
+
 		assertNotNull(st._getRawStylesheet());
 		assertEquals(2, st._getXfsSize());
 		assertEquals(1, st._getStyleXfsSize());
@@ -149,7 +141,7 @@
 		XSSFWorkbook workbook = new XSSFWorkbook(xml.toString());
 		assertNotNull(workbook.getStylesSource());
 		
-		StylesTable st = (StylesTable)workbook.getStylesSource();
+		StylesTable st = workbook.getStylesSource();
 		assertEquals(11, st._getXfsSize());
 		assertEquals(1, st._getStyleXfsSize());
 		assertEquals(8, st._getNumberFormatSize());
@@ -158,11 +150,8 @@
 		long nf2 = st.putNumberFormat("YYYY-mm-DD");
 		assertEquals(nf1, st.putNumberFormat("YYYY-mm-dd"));
 		
-		ByteArrayOutputStream baos = new ByteArrayOutputStream();
-		st.writeTo(baos);
-		ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-		st = new StylesTable(bais);
-		
+        st = XSSFTestDataSamples.writeOutAndReadBack(workbook).getStylesSource();
+
 		assertEquals(11, st._getXfsSize());
 		assertEquals(1, st._getStyleXfsSize());
 		assertEquals(10, st._getNumberFormatSize());

Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCell.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCell.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCell.java (original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCell.java Sun Oct 19 05:54:40 2008
@@ -59,7 +59,7 @@
      */
     public void testSetGetBoolean() throws Exception {
         XSSFRow row = createParentObjects();
-        XSSFCell cell = new XSSFCell(row);
+        XSSFCell cell = row.createCell(0);
         cell.setCellValue(true);
         assertEquals(Cell.CELL_TYPE_BOOLEAN, cell.getCellType());
         assertTrue(cell.getBooleanCellValue());
@@ -79,7 +79,7 @@
      */
     public void testSetGetNumeric() throws Exception {
         XSSFRow row = createParentObjects();
-        XSSFCell cell = new XSSFCell(row);
+        XSSFCell cell = row.createCell(0);
         cell.setCellValue(10d);
         assertEquals(Cell.CELL_TYPE_NUMERIC, cell.getCellType());
         assertEquals(10d, cell.getNumericCellValue());
@@ -92,7 +92,7 @@
      */
     public void testSetGetDate() throws Exception {
         XSSFRow row = createParentObjects();
-        XSSFCell cell = new XSSFCell(row);
+        XSSFCell cell = row.createCell(0);
         Date now = new Date();
         cell.setCellValue(now);
         assertEquals(Cell.CELL_TYPE_NUMERIC, cell.getCellType());
@@ -120,7 +120,7 @@
     
     public void testSetGetError() throws Exception {
         XSSFRow row = createParentObjects();
-        XSSFCell cell = new XSSFCell(row);
+        XSSFCell cell = row.createCell(0);
         
         cell.setCellErrorValue((byte)0);
         assertEquals(Cell.CELL_TYPE_ERROR, cell.getCellType());
@@ -137,7 +137,7 @@
     
     public void testSetGetFormula() throws Exception {
         XSSFRow row = createParentObjects();
-        XSSFCell cell = new XSSFCell(row);
+        XSSFCell cell = row.createCell(0);
         String formula = "SQRT(C2^2+D2^2)";
         
         cell.setCellFormula(formula);
@@ -174,7 +174,7 @@
     
     public void testSetGetStringShared() {
         XSSFRow row = createParentObjects();
-        XSSFCell cell = new XSSFCell(row);
+        XSSFCell cell = row.createCell(0);
 
         cell.setCellValue(new XSSFRichTextString(""));
         assertEquals(Cell.CELL_TYPE_STRING, cell.getCellType());
@@ -190,7 +190,7 @@
      */
     public void testGetEmptyCellValue() {
         XSSFRow row = createParentObjects();
-        XSSFCell cell = new XSSFCell(row);
+        XSSFCell cell = row.createCell(0);
         cell.setCellType(Cell.CELL_TYPE_BOOLEAN);
         assertFalse(cell.getBooleanCellValue());
         cell.setCellType(Cell.CELL_TYPE_NUMERIC);
@@ -214,7 +214,7 @@
     public void testFormatPosition() {
         XSSFRow row = createParentObjects();
         row.setRowNum(0);
-        XSSFCell cell = new XSSFCell(row);
+        XSSFCell cell = row.createCell(0);
         cell.setCellNum((short) 0);
         assertEquals("A1", cell.formatPosition());
         cell.setCellNum((short) 25);
@@ -227,41 +227,20 @@
         assertEquals("IV32768", cell.formatPosition());
     }
     
-    public static class DummySharedStringSource implements SharedStringSource {
-        ArrayList<CTRst> strs = new ArrayList<CTRst>();
-        public CTRst getEntryAt(int idx) {
-            return strs.get(idx);
-        }
-
-        public synchronized int addEntry(CTRst s) {
-            if(strs.contains(s)) {
-                return strs.indexOf(s);
-            }
-            strs.add(s);
-            return strs.size() - 1;
-        }
-    }
-    
     public void testGetCellComment() {
         XSSFWorkbook workbook = new XSSFWorkbook();
-        CTSheet ctSheet = CTSheet.Factory.newInstance();
-        CTWorksheet ctWorksheet = CTWorksheet.Factory.newInstance();
-        CTComments ctComments = CTComments.Factory.newInstance();
-        CommentsTable sheetComments = new CommentsTable(ctComments);
-        XSSFSheet sheet = new XSSFSheet(ctSheet, ctWorksheet, workbook, sheetComments);
+        XSSFSheet sheet = workbook.createSheet();
         assertNotNull(sheet);
-        
+
+        XSSFComment comment = sheet.createComment();
+        comment.setAuthor(TEST_C10_AUTHOR);
+        sheet.setCellComment("C10", comment);
+
         // Create C10 cell
         Row row = sheet.createRow(9);
         row.createCell(2);
         row.createCell(3);
         
-        
-        // Set a comment for C10 cell
-        CTComment ctComment = ctComments.addNewCommentList().insertNewComment(0);
-        ctComment.setRef("C10");
-        ctComment.setAuthorId(sheetComments.findAuthor(TEST_C10_AUTHOR));
-        
         assertNotNull(sheet.getRow(9).getCell((short)2));
         assertNotNull(sheet.getRow(9).getCell((short)2).getCellComment());
         assertEquals(TEST_C10_AUTHOR, sheet.getRow(9).getCell((short)2).getCellComment().getAuthor());
@@ -270,41 +249,35 @@
     
     public void testSetCellComment() {
         XSSFWorkbook workbook = new XSSFWorkbook();
-        CTSheet ctSheet = CTSheet.Factory.newInstance();
-        CTWorksheet ctWorksheet = CTWorksheet.Factory.newInstance();
-        CTComments ctComments = CTComments.Factory.newInstance();
-        CommentsTable comments = new CommentsTable(ctComments);
-        XSSFSheet sheet = new XSSFSheet(ctSheet, ctWorksheet, workbook, comments);
+        XSSFSheet sheet = workbook.createSheet();
         assertNotNull(sheet);
-        
+
+        XSSFComment comment = sheet.createComment();
+        comment.setAuthor(TEST_C10_AUTHOR);
+
+        CTWorksheet ctWorksheet = sheet.getWorksheet();
+
         // Create C10 cell
         Row row = sheet.createRow(9);
         Cell cell = row.createCell(2);
         row.createCell(3);
-        
-        // Create a comment
-        Comment comment = comments.addComment();
-        comment.setAuthor(TEST_C10_AUTHOR);
-        
+
         // Set a comment for C10 cell
         cell.setCellComment(comment);
         
         CTCell ctCell = ctWorksheet.getSheetData().getRowArray(0).getCArray(0);
 		assertNotNull(ctCell);
 		assertEquals("C10", ctCell.getR());
-		long authorId = ctComments.getCommentList().getCommentArray(0).getAuthorId();
-		assertEquals(TEST_C10_AUTHOR, comments.getAuthor(authorId));
+		assertEquals(TEST_C10_AUTHOR, comment.getAuthor());
     }
     
     public void testSetAsActiveCell() {
-    	Workbook workbook = new XSSFWorkbook();
-    	CTSheet ctSheet = CTSheet.Factory.newInstance();
-    	CTWorksheet ctWorksheet = CTWorksheet.Factory.newInstance();
-    	XSSFSheet sheet = new XSSFSheet(ctSheet, ctWorksheet, (XSSFWorkbook) workbook);
+    	XSSFWorkbook workbook = new XSSFWorkbook();
+    	XSSFSheet sheet = workbook.createSheet();
     	Cell cell = sheet.createRow(0).createCell((short)0);
     	cell.setAsActiveCell();
     	
-    	assertEquals("A1", ctWorksheet.getSheetViews().getSheetViewArray(0).getSelectionArray(0).getActiveCell());
+    	assertEquals("A1", sheet.getWorksheet().getSheetViews().getSheetViewArray(0).getSelectionArray(0).getActiveCell());
     }
     
     
@@ -345,9 +318,8 @@
 
     private static XSSFRow createParentObjects() {
         XSSFWorkbook wb = new XSSFWorkbook();
-        wb.setSharedStringSource(new SharedStringsTable());
-        XSSFSheet sheet = new XSSFSheet(wb);
-        XSSFRow row = new XSSFRow(sheet);
+        XSSFSheet sheet = wb.createSheet();
+        XSSFRow row = sheet.createRow(0);
         return row;
     }
 

Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFComment.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFComment.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFComment.java (original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFComment.java Sun Oct 19 05:54:40 2008
@@ -25,155 +25,164 @@
 import org.apache.poi.ss.util.CellReference;
 import org.apache.poi.xssf.model.CommentsTable;
 import org.apache.poi.xssf.XSSFTestDataSamples;
-import org.openxml4j.opc.Package;
+import org.apache.poi.POIXMLDocumentPart;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTAuthors;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComments;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument;
 
 import junit.framework.TestCase;
 
+import java.io.ByteArrayOutputStream;
+import java.io.ByteArrayInputStream;
+
 
 public class TestXSSFComment extends TestCase {
-    
-	private static final String TEST_RICHTEXTSTRING = "test richtextstring";
-	private static final String TEST_AUTHOR = "test_author";
-
-	public void testConstructors() {
-		CommentsTable sheetComments = new CommentsTable();
-		XSSFComment comment = sheetComments.addComment();
-		assertNotNull(comment);
-		
-		CTComment ctComment = CTComment.Factory.newInstance();
-		XSSFComment comment2 = new XSSFComment(sheetComments, ctComment);
-		assertNotNull(comment2);
-	}
-	
-	public void testGetColumn() {
-		CommentsTable sheetComments = new CommentsTable();
-		CTComment ctComment = CTComment.Factory.newInstance();
-		ctComment.setRef("A1");
-		XSSFComment comment = new XSSFComment(sheetComments, ctComment);
-		assertNotNull(comment);
-		assertEquals(0, comment.getColumn());
-		ctComment.setRef("C10");
-		assertEquals(2, comment.getColumn());
-	}
-	
-	public void testGetRow() {
-		CommentsTable sheetComments = new CommentsTable();
-		CTComment ctComment = CTComment.Factory.newInstance();
-		ctComment.setRef("A1");
-		XSSFComment comment = new XSSFComment(sheetComments, ctComment);
-		assertNotNull(comment);
-		assertEquals(0, comment.getRow());
-		ctComment.setRef("C10");
-		assertEquals(9, comment.getRow());
-	}
-	
-	public void testGetAuthor() {
-		CTComments ctComments = CTComments.Factory.newInstance();
-		CTComment ctComment = ctComments.addNewCommentList().addNewComment();
-		CTAuthors ctAuthors = ctComments.addNewAuthors();
-		ctAuthors.insertAuthor(0, TEST_AUTHOR);
-		ctComment.setAuthorId(0);
-
-		CommentsTable sheetComments = new CommentsTable(ctComments);
-		XSSFComment comment = new XSSFComment(sheetComments, ctComment);
-		assertNotNull(comment);
-		assertEquals(TEST_AUTHOR, comment.getAuthor());
-	}
-	
-	public void testSetColumn() {
-		CommentsTable sheetComments = new CommentsTable();
-		CTComment ctComment = CTComment.Factory.newInstance();
-		XSSFComment comment = new XSSFComment(sheetComments, ctComment);
-		comment.setColumn((short)3);
-		assertEquals(3, comment.getColumn());
-		assertEquals(3, (new CellReference(ctComment.getRef()).getCol()));
-		assertEquals("D1", ctComment.getRef());
-
-		comment.setColumn((short)13);
-		assertEquals(13, comment.getColumn());
-	}
-	
-	public void testSetRow() {
-		CommentsTable sheetComments = new CommentsTable();
-		CTComment ctComment = CTComment.Factory.newInstance();
-		XSSFComment comment = new XSSFComment(sheetComments, ctComment);
-		comment.setRow(20);
-		assertEquals(20, comment.getRow());
-		assertEquals(20, (new CellReference(ctComment.getRef()).getRow()));
-		assertEquals("A21", ctComment.getRef());
-
-		comment.setRow(19);
-		assertEquals(19, comment.getRow());
-	}
-	
-	public void testSetAuthor() {
-		CommentsTable sheetComments = new CommentsTable();
-		CTComment ctComment = CTComment.Factory.newInstance();
-		XSSFComment comment = new XSSFComment(sheetComments, ctComment);
-		comment.setAuthor(TEST_AUTHOR);
-		assertEquals(TEST_AUTHOR, comment.getAuthor());
-	}
-	
-	public void testSetString() {
-		CommentsTable sheetComments = new CommentsTable();
-		CTComment ctComment = CTComment.Factory.newInstance();
-		XSSFComment comment = new XSSFComment(sheetComments, ctComment);
-		RichTextString richTextString = new HSSFRichTextString(TEST_RICHTEXTSTRING);
-		comment.setString(richTextString);
-		assertEquals(TEST_RICHTEXTSTRING, ctComment.getText().getT());
-	}
-    
-	/**
-	 * Tests that we can add comments to a new
-	 *  file, save, load, and still see them
-	 * @throws Exception
-	 */
-	public void testCreateSave() throws Exception {
-		XSSFWorkbook wb = new XSSFWorkbook();
-		XSSFSheet s1 = wb.createSheet();
-		Row r1 = s1.createRow(0);
-		Cell r1c1 = r1.createCell(0);
-		r1c1.setCellValue(2.2);
-		
-		assertEquals(0, s1.getNumberOfComments());
-		
-		Comment c1 = s1.createComment();
-		c1.setAuthor("Author 1");
-		c1.setString(new XSSFRichTextString("Comment 1"));
-		r1c1.setCellComment(c1);
-		
-		assertEquals(1, s1.getNumberOfComments());
-		
-		// Save and re-load
-		wb = XSSFTestDataSamples.writeOutAndReadBack(wb);
-		s1 = wb.getSheetAt(0);
-		
-		assertEquals(1, s1.getNumberOfComments());
-		assertNotNull(s1.getRow(0).getCell(0).getCellComment());
-		assertEquals("Author 1", s1.getRow(0).getCell(0).getCellComment().getAuthor());
-		assertEquals("Comment 1", s1.getRow(0).getCell(0).getCellComment().getString().getString());
-		
-		// Now add an orphaned one
-		Comment c2 = s1.createComment();
-		c2.setAuthor("Author 2");
-		c2.setString(new XSSFRichTextString("Second Comment"));
-		c2.setRow(0);
-		c2.setColumn((short)1);
-		assertEquals(2, s1.getNumberOfComments());
-		
-		// Save and re-load
-
-		wb = XSSFTestDataSamples.writeOutAndReadBack(wb);
-		s1 = wb.getSheetAt(0);
-		
-		assertEquals(2, s1.getNumberOfComments());
-		assertNotNull(s1.getCellComment(0, 0));
-		assertNotNull(s1.getCellComment(0, 1));
-		
-		assertEquals("Author 1", s1.getCellComment(0, 0).getAuthor());
-		assertEquals("Author 2", s1.getCellComment(0, 1).getAuthor());
-	}
+
+    private static final String TEST_RICHTEXTSTRING = "test richtextstring";
+    private static final String TEST_AUTHOR = "test_author";
+
+    public void testConstructors() {
+        CommentsTable sheetComments = new CommentsTable();
+        XSSFComment comment = sheetComments.addComment();
+        assertNotNull(comment);
+
+        CTComment ctComment = CTComment.Factory.newInstance();
+        XSSFComment comment2 = new XSSFComment(sheetComments, ctComment);
+        assertNotNull(comment2);
+    }
+
+    public void testGetColumn() {
+        CommentsTable sheetComments = new CommentsTable();
+        CTComment ctComment = CTComment.Factory.newInstance();
+        ctComment.setRef("A1");
+        XSSFComment comment = new XSSFComment(sheetComments, ctComment);
+        assertNotNull(comment);
+        assertEquals(0, comment.getColumn());
+        ctComment.setRef("C10");
+        assertEquals(2, comment.getColumn());
+    }
+
+    public void testGetRow() {
+        CommentsTable sheetComments = new CommentsTable();
+        CTComment ctComment = CTComment.Factory.newInstance();
+        ctComment.setRef("A1");
+        XSSFComment comment = new XSSFComment(sheetComments, ctComment);
+        assertNotNull(comment);
+        assertEquals(0, comment.getRow());
+        ctComment.setRef("C10");
+        assertEquals(9, comment.getRow());
+    }
+
+    public void testGetAuthor() throws Exception {
+        CommentsDocument doc = CommentsDocument.Factory.newInstance();
+        CTComments ctComments = CTComments.Factory.newInstance();
+        CTComment ctComment = ctComments.addNewCommentList().addNewComment();
+        CTAuthors ctAuthors = ctComments.addNewAuthors();
+        ctAuthors.insertAuthor(0, TEST_AUTHOR);
+        ctComment.setAuthorId(0);
+        doc.setComments(ctComments);
+
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        doc.save(out, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
+
+        CommentsTable sheetComments = new CommentsTable();
+        sheetComments.readFrom(new ByteArrayInputStream(out.toByteArray()));
+        XSSFComment comment = new XSSFComment(sheetComments, ctComment);
+        assertEquals(TEST_AUTHOR, comment.getAuthor());
+    }
+
+    public void testSetColumn() {
+        CommentsTable sheetComments = new CommentsTable();
+        CTComment ctComment = CTComment.Factory.newInstance();
+        XSSFComment comment = new XSSFComment(sheetComments, ctComment);
+        comment.setColumn((short)3);
+        assertEquals(3, comment.getColumn());
+        assertEquals(3, (new CellReference(ctComment.getRef()).getCol()));
+        assertEquals("D1", ctComment.getRef());
+
+        comment.setColumn((short)13);
+        assertEquals(13, comment.getColumn());
+    }
+
+    public void testSetRow() {
+        CommentsTable sheetComments = new CommentsTable();
+        CTComment ctComment = CTComment.Factory.newInstance();
+        XSSFComment comment = new XSSFComment(sheetComments, ctComment);
+        comment.setRow(20);
+        assertEquals(20, comment.getRow());
+        assertEquals(20, (new CellReference(ctComment.getRef()).getRow()));
+        assertEquals("A21", ctComment.getRef());
+
+        comment.setRow(19);
+        assertEquals(19, comment.getRow());
+    }
+
+    public void testSetAuthor() {
+        CommentsTable sheetComments = new CommentsTable();
+        CTComment ctComment = CTComment.Factory.newInstance();
+        XSSFComment comment = new XSSFComment(sheetComments, ctComment);
+        comment.setAuthor(TEST_AUTHOR);
+        assertEquals(TEST_AUTHOR, comment.getAuthor());
+    }
+
+    public void testSetString() {
+        CommentsTable sheetComments = new CommentsTable();
+        CTComment ctComment = CTComment.Factory.newInstance();
+        XSSFComment comment = new XSSFComment(sheetComments, ctComment);
+        RichTextString richTextString = new HSSFRichTextString(TEST_RICHTEXTSTRING);
+        comment.setString(richTextString);
+        assertEquals(TEST_RICHTEXTSTRING, ctComment.getText().getT());
+    }
+
+    /**
+     * Tests that we can add comments to a new
+     *  file, save, load, and still see them
+     * @throws Exception
+     */
+    public void testCreateSave() throws Exception {
+        XSSFWorkbook wb = new XSSFWorkbook();
+        XSSFSheet s1 = wb.createSheet();
+        Row r1 = s1.createRow(0);
+        Cell r1c1 = r1.createCell(0);
+        r1c1.setCellValue(2.2);
+
+        assertEquals(0, s1.getNumberOfComments());
+
+        Comment c1 = s1.createComment();
+        c1.setAuthor("Author 1");
+        c1.setString(new XSSFRichTextString("Comment 1"));
+        r1c1.setCellComment(c1);
+
+        assertEquals(1, s1.getNumberOfComments());
+
+        // Save and re-load
+        wb = XSSFTestDataSamples.writeOutAndReadBack(wb);
+        s1 = wb.getSheetAt(0);
+
+        assertEquals(1, s1.getNumberOfComments());
+        assertNotNull(s1.getRow(0).getCell(0).getCellComment());
+        assertEquals("Author 1", s1.getRow(0).getCell(0).getCellComment().getAuthor());
+        assertEquals("Comment 1", s1.getRow(0).getCell(0).getCellComment().getString().getString());
+
+        // Now add an orphaned one
+        Comment c2 = s1.createComment();
+        c2.setAuthor("Author 2");
+        c2.setString(new XSSFRichTextString("Second Comment"));
+        c2.setRow(0);
+        c2.setColumn((short)1);
+        assertEquals(2, s1.getNumberOfComments());
+
+        // Save and re-load
+
+        wb = XSSFTestDataSamples.writeOutAndReadBack(wb);
+        s1 = wb.getSheetAt(0);
+
+        assertEquals(2, s1.getNumberOfComments());
+        assertNotNull(s1.getCellComment(0, 0));
+        assertNotNull(s1.getCellComment(0, 1));
+
+        assertEquals("Author 1", s1.getCellComment(0, 0).getAuthor());
+        assertEquals("Author 2", s1.getCellComment(0, 1).getAuthor());
+    }
 }

Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDialogSheet.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDialogSheet.java?rev=706003&r1=706002&r2=706003&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDialogSheet.java (original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFDialogSheet.java Sun Oct 19 05:54:40 2008
@@ -27,15 +27,7 @@
 
 public class TestXSSFDialogSheet extends TestCase {
 	
-	public void testDialogsheetConstructor() {
-        XSSFWorkbook workbook = new XSSFWorkbook();
-        Sheet sheet = workbook.createSheet("Sheet 1");
-		XSSFDialogsheet dialogsheet = new XSSFDialogsheet(CTSheet.Factory.newInstance(), CTDialogsheet.Factory.newInstance(), workbook);
-		assertNotNull(dialogsheet);
-		XSSFDialogsheet dialogsheet2 = new XSSFDialogsheet(CTSheet.Factory.newInstance(), null, workbook);
-		assertNotNull(dialogsheet2);
-	}
-	
+
 	public void testCreateDialogSheet() {
         XSSFWorkbook workbook = new XSSFWorkbook();
         Sheet dialogsheet = workbook.createDialogsheet("Dialogsheet 1", CTDialogsheet.Factory.newInstance());



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