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/28 11:03:53 UTC
svn commit: r708497 - in /poi/branches/ooxml: ./
src/examples/src/org/apache/poi/xssf/usermodel/examples/
src/java/org/apache/poi/hssf/usermodel/
src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/
src/ooxml/java/org/apache/poi/xssf/model/ src/ooxm...
Author: yegor
Date: Tue Oct 28 03:03:51 2008
New Revision: 708497
URL: http://svn.apache.org/viewvc?rev=708497&view=rev
Log:
1. moved ooxml enums into interfaces-jdk15, they are common and should be in the place as the interfaces 2. removed obsolete and deprecated classes 3. Fixed XSSFWorkbook.cloneSheet. Now it makes a 'true' deep copy of a sheet 4. ooxml has a compile-time dependency on scratchpad, fixed build.xml to reflect that
Added:
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/BorderStyle.java
- copied, changed from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/BorderStyle.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FillPatternType.java
- copied, changed from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FillPatternType.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontCharset.java
- copied, changed from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontCharset.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontFamily.java
- copied, changed from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontFamily.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontScheme.java
- copied, changed from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontScheme.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontUndeline.java
- copied unchanged from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontUnderline.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/HorizontalAlignment.java
- copied, changed from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/HorizontalAlignment.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/IndexedColors.java
- copied, changed from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/IndexedColors.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PageOrder.java
- copied, changed from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PageOrder.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PaperSize.java
- copied, changed from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PaperSize.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PrintCellComments.java
- copied, changed from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintCellComments.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PrintOrientation.java
- copied, changed from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintOrientation.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/ShapeTypes.java
- copied, changed from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/ShapeTypes.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/VerticalAlignment.java
- copied, changed from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/VerticalAlignment.java
Removed:
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/CommentsSource.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Palette.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Patriarch.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/StylesSource.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/BinaryPart.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/Control.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/Drawing.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/SharedStringSource.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/model/ThemeTable.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/HorizontalAlignment.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/ShapeTypes.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/VerticalAlignment.java
Modified:
poi/branches/ooxml/build.xml
poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/FillsAndColors.java
poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/HyperlinkExample.java
poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithBorders.java
poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithFonts.java
poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithRichText.java
poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java
poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/CellStyle.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Row.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Sheet.java
poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Workbook.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/StylesTable.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConnector.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataFormat.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationCell.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.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/XSSFSheet.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellAlignment.java
poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellBorder.java
poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java
poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFont.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/TestXSSFWorkbook.java
poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFBorder.java
poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFCellFill.java
Modified: poi/branches/ooxml/build.xml
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/build.xml?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/build.xml (original)
+++ poi/branches/ooxml/build.xml Tue Oct 28 03:03:51 2008
@@ -519,7 +519,7 @@
</javac>
</target>
- <target name="compile-ooxml" depends="init, check-ooxml-xsds, fetch-ooxml-xsds, compile-ooxml-xsds, compile-main">
+ <target name="compile-ooxml" depends="init, check-ooxml-xsds, fetch-ooxml-xsds, compile-ooxml-xsds, compile-main, compile-scratchpad">
<!-- openxml4j requires java 1.5, so so must we, for now -->
<javac target="1.5" source="1.5"
destdir="${ooxml.output.dir}" debug="on" srcdir="${ooxml.src}">
Modified: poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/FillsAndColors.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/FillsAndColors.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/FillsAndColors.java (original)
+++ poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/FillsAndColors.java Tue Oct 28 03:03:51 2008
@@ -18,12 +18,8 @@
import java.io.FileOutputStream;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.IndexedColors;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
Modified: poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/HyperlinkExample.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/HyperlinkExample.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/HyperlinkExample.java (original)
+++ poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/HyperlinkExample.java Tue Oct 28 03:03:51 2008
@@ -18,15 +18,9 @@
import java.io.FileOutputStream;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.CreationHelper;
-import org.apache.poi.ss.usermodel.Font;
-import org.apache.poi.ss.usermodel.Hyperlink;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.apache.poi.xssf.usermodel.IndexedColors;
+import org.apache.poi.ss.usermodel.IndexedColors;
/**
* Demonstrates how to create hyperlinks.
Modified: poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithBorders.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithBorders.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithBorders.java (original)
+++ poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithBorders.java Tue Oct 28 03:03:51 2008
@@ -17,7 +17,7 @@
package org.apache.poi.xssf.usermodel.examples;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.apache.poi.xssf.usermodel.IndexedColors;
+import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.*;
import java.io.FileOutputStream;
Modified: poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithFonts.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithFonts.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithFonts.java (original)
+++ poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithFonts.java Tue Oct 28 03:03:51 2008
@@ -16,13 +16,9 @@
==================================================================== */
package org.apache.poi.xssf.usermodel.examples;
-import org.apache.poi.hssf.usermodel.HSSFFont;
-import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.apache.poi.xssf.usermodel.XSSFRichTextString;
-import org.apache.poi.xssf.usermodel.IndexedColors;
-import org.apache.poi.xssf.usermodel.extensions.XSSFColor;
+import org.apache.poi.ss.usermodel.IndexedColors;
import java.io.FileOutputStream;
Modified: poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithRichText.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithRichText.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithRichText.java (original)
+++ poi/branches/ooxml/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithRichText.java Tue Oct 28 03:03:51 2008
@@ -18,13 +18,8 @@
import org.apache.poi.xssf.usermodel.*;
import org.apache.poi.ss.usermodel.*;
-import org.apache.poi.hssf.util.HSSFColor;
-import org.apache.xmlbeans.XmlOptions;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.*;
import java.io.FileOutputStream;
-import java.io.Writer;
-import java.io.StringWriter;
/**
* Demonstrates how to work with rich text
Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java Tue Oct 28 03:03:51 2008
@@ -19,7 +19,6 @@
import org.apache.poi.hssf.record.PaletteRecord;
import org.apache.poi.hssf.util.HSSFColor;
-import org.apache.poi.ss.usermodel.Palette;
/**
* Represents a workbook color palette.
@@ -29,7 +28,7 @@
*
* @author Brian Sanders (bsanders at risklabs dot com)
*/
-public class HSSFPalette implements Palette
+public class HSSFPalette
{
private PaletteRecord palette;
Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java Tue Oct 28 03:03:51 2008
@@ -25,7 +25,6 @@
import org.apache.poi.ddf.EscherOptRecord;
import org.apache.poi.ddf.EscherProperty;
import org.apache.poi.hssf.record.EscherAggregate;
-import org.apache.poi.ss.usermodel.Patriarch;
import org.apache.poi.util.StringUtil;
/**
@@ -35,7 +34,7 @@
* @author Glen Stampoultzis (glens at apache.org)
*/
public class HSSFPatriarch
- implements HSSFShapeContainer, Patriarch
+ implements HSSFShapeContainer
{
List shapes = new ArrayList();
HSSFSheet sheet;
Copied: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/BorderStyle.java (from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/BorderStyle.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/BorderStyle.java?p2=poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/BorderStyle.java&p1=poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/BorderStyle.java&r1=708487&r2=708497&rev=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/BorderStyle.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/BorderStyle.java Tue Oct 28 03:03:51 2008
@@ -15,7 +15,7 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.xssf.usermodel;
+package org.apache.poi.ss.usermodel;
/**
* The enumeration value indicating the line style of a border in a cell,
Modified: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/CellStyle.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/CellStyle.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/CellStyle.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/CellStyle.java Tue Oct 28 03:03:51 2008
@@ -227,7 +227,7 @@
public final static short LEAST_DOTS = 18;
/**
- * get the index within the HSSFWorkbook (sequence within the collection of ExtnededFormat objects)
+ * get the index within the Workbook (sequence within the collection of ExtnededFormat objects)
* @return unique index number of the underlying record this style represents (probably you don't care
* unless you're comparing which one is which)
*/
@@ -236,14 +236,14 @@
/**
* set the data format (must be a valid format)
- * @see org.apache.poi.hssf.usermodel.HSSFDataFormat
+ * @see DataFormat
*/
void setDataFormat(short fmt);
/**
* get the index of the format
- * @see org.apache.poi.hssf.usermodel.HSSFDataFormat
+ * @see DataFormat
*/
short getDataFormat();
@@ -253,26 +253,17 @@
public String getDataFormatString();
/**
- * Get the contents of the format string, by looking up
- * the DataFormat against the supplied workbook
- * @see org.apache.poi.hssf.usermodel.HSSFDataFormat
- * XXX Commented out because it uses internal implementation Workbook class.
- *
- String getDataFormatString(Workbook workbook);
- */
-
- /**
* set the font for this style
- * @param font a font object created or retreived from the HSSFWorkbook object
- * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#createFont()
- * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt(short)
+ * @param font a font object created or retreived from the Workbook object
+ * @see Workbook#createFont()
+ * @see Workbook#getFontAt(short)
*/
void setFont(Font font);
/**
* gets the index of the font for this style
- * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt(short)
+ * @see Workbook#getFontAt(short)
*/
short getFontIndex();
@@ -571,8 +562,6 @@
/**
* get the color to use for the left border
- * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
- * @param color The index of the color definition
*/
short getLeftBorderColor();
@@ -584,8 +573,7 @@
/**
* get the color to use for the left border
- * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
- * @param color The index of the color definition
+ * @return the index of the color definition
*/
short getRightBorderColor();
@@ -597,8 +585,7 @@
/**
* get the color to use for the top border
- * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
- * @param color The index of the color definition
+ * @return hhe index of the color definition
*/
short getTopBorderColor();
@@ -610,8 +597,7 @@
/**
* get the color to use for the left border
- * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
- * @param color The index of the color definition
+ * @return the index of the color definition
*/
short getBottomBorderColor();
@@ -650,26 +636,6 @@
/**
* set the background fill color.
- * <p>
- * For example:
- * <pre>
- * cs.setFillPattern(HSSFCellStyle.FINE_DOTS );
- * cs.setFillBackgroundColor(new HSSFColor.RED().getIndex());
- * </pre>
- * optionally a Foreground and background fill can be applied:
- * <i>Note: Ensure Foreground color is set prior to background</i>
- * <pre>
- * cs.setFillPattern(HSSFCellStyle.FINE_DOTS );
- * cs.setFillForegroundColor(new HSSFColor.BLUE().getIndex());
- * cs.setFillBackgroundColor(new HSSFColor.RED().getIndex());
- * </pre>
- * or, for the special case of SOLID_FILL:
- * <pre>
- * cs.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND );
- * cs.setFillForegroundColor(new HSSFColor.RED().getIndex());
- * </pre>
- * It is necessary to set the fill style in order
- * for the color to be shown in the cell.
*
* @param bg color
*/
@@ -678,7 +644,6 @@
/**
* get the background fill color
- * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
* @return fill color
*/
short getFillBackgroundColor();
@@ -692,7 +657,6 @@
/**
* get the foreground fill color
- * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
* @return fill color
*/
short getFillForegroundColor();
Copied: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FillPatternType.java (from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FillPatternType.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FillPatternType.java?p2=poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FillPatternType.java&p1=poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FillPatternType.java&r1=708487&r2=708497&rev=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FillPatternType.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FillPatternType.java Tue Oct 28 03:03:51 2008
@@ -15,7 +15,7 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.xssf.usermodel;
+package org.apache.poi.ss.usermodel;
/**
* The enumeration value indicating the style of fill pattern being used for a cell format.
Copied: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontCharset.java (from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontCharset.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontCharset.java?p2=poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontCharset.java&p1=poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontCharset.java&r1=708487&r2=708497&rev=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontCharset.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontCharset.java Tue Oct 28 03:03:51 2008
@@ -15,7 +15,7 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.xssf.usermodel;
+package org.apache.poi.ss.usermodel;
/**
Copied: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontFamily.java (from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontFamily.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontFamily.java?p2=poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontFamily.java&p1=poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontFamily.java&r1=708487&r2=708497&rev=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontFamily.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontFamily.java Tue Oct 28 03:03:51 2008
@@ -15,7 +15,7 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.xssf.usermodel;
+package org.apache.poi.ss.usermodel;
/**
Copied: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontScheme.java (from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontScheme.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontScheme.java?p2=poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontScheme.java&p1=poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontScheme.java&r1=708487&r2=708497&rev=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/FontScheme.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/FontScheme.java Tue Oct 28 03:03:51 2008
@@ -15,7 +15,7 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.xssf.usermodel;
+package org.apache.poi.ss.usermodel;
/**
Copied: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/HorizontalAlignment.java (from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/HorizontalAlignment.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/HorizontalAlignment.java?p2=poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/HorizontalAlignment.java&p1=poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/HorizontalAlignment.java&r1=708487&r2=708497&rev=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/HorizontalAlignment.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/HorizontalAlignment.java Tue Oct 28 03:03:51 2008
@@ -15,7 +15,7 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.xssf.usermodel;
+package org.apache.poi.ss.usermodel;
/**
* The enumeration value indicating horizontal alignment of a cell,
Copied: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/IndexedColors.java (from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/IndexedColors.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/IndexedColors.java?p2=poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/IndexedColors.java&p1=poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/IndexedColors.java&r1=708487&r2=708497&rev=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/IndexedColors.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/IndexedColors.java Tue Oct 28 03:03:51 2008
@@ -15,7 +15,7 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.xssf.usermodel;
+package org.apache.poi.ss.usermodel;
/**
* A deprecated indexing scheme for colours that is still required for some records, and for backwards
Copied: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PageOrder.java (from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PageOrder.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PageOrder.java?p2=poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PageOrder.java&p1=poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PageOrder.java&r1=708487&r2=708497&rev=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PageOrder.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PageOrder.java Tue Oct 28 03:03:51 2008
@@ -15,7 +15,7 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.xssf.usermodel;
+package org.apache.poi.ss.usermodel;
/**
* Specifies printed page order.
Copied: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PaperSize.java (from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PaperSize.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PaperSize.java?p2=poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PaperSize.java&p1=poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PaperSize.java&r1=708487&r2=708497&rev=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PaperSize.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PaperSize.java Tue Oct 28 03:03:51 2008
@@ -15,7 +15,7 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.xssf.usermodel;
+package org.apache.poi.ss.usermodel;
/**
* The enumeration value indicating the possible paper size for a sheet
Copied: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PrintCellComments.java (from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintCellComments.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PrintCellComments.java?p2=poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PrintCellComments.java&p1=poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintCellComments.java&r1=708487&r2=708497&rev=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintCellComments.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PrintCellComments.java Tue Oct 28 03:03:51 2008
@@ -15,7 +15,7 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.xssf.usermodel;
+package org.apache.poi.ss.usermodel;
/**
* These enumerations specify how cell comments shall be displayed for paper printing purposes.
Copied: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PrintOrientation.java (from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintOrientation.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PrintOrientation.java?p2=poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PrintOrientation.java&p1=poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintOrientation.java&r1=708487&r2=708497&rev=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/PrintOrientation.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/PrintOrientation.java Tue Oct 28 03:03:51 2008
@@ -15,7 +15,7 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.xssf.usermodel;
+package org.apache.poi.ss.usermodel;
/**
* The enumeration value indicating the print orientation for a sheet.
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=708497&r1=708496&r2=708497&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 Tue Oct 28 03:03:51 2008
@@ -21,10 +21,6 @@
import java.util.Iterator;
public interface Row extends Iterable<Cell> {
-
- // used for collections
- public final static int INITIAL_CAPACITY = 5;
-
/**
* Use this to create new cells within the row and return it.
* <p>
Copied: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/ShapeTypes.java (from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/ShapeTypes.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/ShapeTypes.java?p2=poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/ShapeTypes.java&p1=poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/ShapeTypes.java&r1=708487&r2=708497&rev=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/ShapeTypes.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/ShapeTypes.java Tue Oct 28 03:03:51 2008
@@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-package org.apache.poi.xssf.usermodel;
+package org.apache.poi.ss.usermodel;
/**
* All known types of automatic shapes in DrawingML
Modified: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Sheet.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Sheet.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Sheet.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Sheet.java Tue Oct 28 03:03:51 2008
@@ -46,19 +46,11 @@
public static final byte PANE_UPPER_LEFT = (byte) 3;
/**
- * Used for compile-time optimization. This is the initial size for the collection of
- * rows. It is currently set to 20. If you generate larger sheets you may benefit
- * by setting this to a higher number and recompiling a custom edition of HSSFSheet.
- */
-
- public final static int INITIAL_CAPACITY = 20;
-
- /**
* Create a new row within the sheet and return the high level representation
*
* @param rownum row number
- * @return High level HSSFRow object representing a row in the sheet
- * @see org.apache.poi.hssf.usermodel.HSSFRow
+ * @return High level Row object representing a row in the sheet
+ * @see Row
* @see #removeRow(Row)
*/
Row createRow(int rownum);
@@ -75,7 +67,7 @@
* Returns the logical row (not physical) 0-based. If you ask for a row that is not
* defined you get a null. This is to say row 4 represents the fifth row on a sheet.
* @param rownum row to get
- * @return HSSFRow representing the rownumber or null if its not defined on the sheet
+ * @return Row representing the rownumber or null if its not defined on the sheet
*/
Row getRow(int rownum);
Copied: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/VerticalAlignment.java (from r708487, poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/VerticalAlignment.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/VerticalAlignment.java?p2=poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/VerticalAlignment.java&p1=poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/VerticalAlignment.java&r1=708487&r2=708497&rev=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/VerticalAlignment.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/VerticalAlignment.java Tue Oct 28 03:03:51 2008
@@ -15,7 +15,7 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.xssf.usermodel;
+package org.apache.poi.ss.usermodel;
/**
* This enumeration value indicates the type of vertical alignment for a cell, i.e.,
Modified: poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Workbook.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Workbook.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Workbook.java (original)
+++ poi/branches/ooxml/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Workbook.java Tue Oct 28 03:03:51 2008
@@ -25,15 +25,6 @@
public interface Workbook {
- /**
- * used for compile-time performance/memory optimization. This determines the
- * initial capacity for the sheet collection. Its currently set to 3.
- * Changing it in this release will decrease performance
- * since you're never allowed to have more or less than three sheets!
- */
-
- public final static int INITIAL_CAPACITY = 3;
-
/** Extended windows meta file */
public static final int PICTURE_TYPE_EMF = 2;
@@ -72,21 +63,12 @@
* This may be different from the "selected sheet" since excel seems to
* allow you to show the data of one sheet when another is seen "selected"
* in the tabs (at the bottom).
- * @see org.apache.poi.hssf.usermodel.HSSFSheet#setSelected(boolean)
+ * @see Sheet#setSelected(boolean)
* @param index
*/
void setSelectedTab(short index);
/**
- * gets the tab whose data is actually seen when the sheet is opened.
- * This may be different from the "selected sheet" since excel seems to
- * allow you to show the data of one sheet when another is seen "selected"
- * in the tabs (at the bottom).
- * @see org.apache.poi.hssf.usermodel.HSSFSheet#setSelected(boolean)
- */
- short getSelectedTab();
-
- /**
* set the sheet name.
* Will throw IllegalArgumentException if the name is greater than 31 chars
* or contains /\?*[]
@@ -115,28 +97,28 @@
int getSheetIndex(Sheet sheet);
/**
- * create an HSSFSheet for this HSSFWorkbook, adds it to the sheets and returns
+ * create an Sheet for this Workbook, adds it to the sheets and returns
* the high level representation. Use this to create new sheets.
*
- * @return HSSFSheet representing the new sheet.
+ * @return Sheet representing the new sheet.
*/
Sheet createSheet();
/**
- * create an HSSFSheet from an existing sheet in the HSSFWorkbook.
+ * create an Sheet from an existing sheet in the Workbook.
*
- * @return HSSFSheet representing the cloned sheet.
+ * @return Sheet representing the cloned sheet.
*/
Sheet cloneSheet(int sheetNum);
/**
- * create an HSSFSheet for this HSSFWorkbook, adds it to the sheets and returns
+ * create an Sheet for this Workbook, adds it to the sheets and returns
* the high level representation. Use this to create new sheets.
*
* @param sheetname sheetname to set for the sheet.
- * @return HSSFSheet representing the new sheet.
+ * @return Sheet representing the new sheet.
*/
Sheet createSheet(String sheetname);
@@ -149,9 +131,9 @@
int getNumberOfSheets();
/**
- * Get the HSSFSheet object at the given index.
+ * Get the Sheet object at the given index.
* @param index of the sheet number (0-based physical & logical)
- * @return HSSFSheet at the provided index
+ * @return Sheet at the provided index
*/
Sheet getSheetAt(int index);
@@ -159,7 +141,7 @@
/**
* Get sheet with the given name
* @param name of the sheet
- * @return HSSFSheet with the name provided or null if it does not exist
+ * @return Sheet with the name provided or null if it does not exist
*/
Sheet getSheet(String name);
@@ -220,7 +202,7 @@
/**
* get the font at the given index number
* @param idx index number
- * @return HSSFFont at the index
+ * @return XSSFFont at the index
*/
Font getFontAt(short idx);
@@ -242,7 +224,7 @@
/**
* get the cell style object at the given index
* @param idx index within the set of styles
- * @return HSSFCellStyle object at the index
+ * @return CellStyle object at the index
*/
CellStyle getCellStyleAt(short idx);
@@ -271,12 +253,6 @@
*/
Name getNameAt(int index);
- /** gets the named range name
- * @param index the named range index (0 based)
- * @return named range name
- */
- String getNameName(int index);
-
/**
* Sets the printarea for the sheet provided
* <p>
@@ -346,10 +322,8 @@
void removeName(int index);
/**
- * Returns the instance of HSSFDataFormat for this workbook.
- * @return the HSSFDataFormat object
- * @see org.apache.poi.hssf.record.FormatRecord
- * @see org.apache.poi.hssf.record.Record
+ * Returns the instance of DataFormat for this workbook.
+ * @return the DataFormat object
*/
DataFormat createDataFormat();
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=708497&r1=708496&r2=708497&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 Tue Oct 28 03:03:51 2008
@@ -20,12 +20,10 @@
import java.io.InputStream;
import java.io.OutputStream;
-import org.apache.poi.ss.usermodel.CommentsSource;
import org.apache.poi.ss.util.CellReference;
import org.apache.poi.xssf.usermodel.XSSFComment;
import org.apache.poi.POIXMLDocumentPart;
import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlOptions;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTAuthors;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTComment;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCommentList;
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=708497&r1=708496&r2=708497&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 Tue Oct 28 03:03:51 2008
@@ -23,15 +23,13 @@
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Hashtable;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map.Entry;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
-import org.apache.poi.ss.usermodel.StylesSource;
-import org.apache.poi.xssf.usermodel.FontFamily;
-import org.apache.poi.xssf.usermodel.FontScheme;
+import org.apache.poi.ss.usermodel.FontFamily;
+import org.apache.poi.ss.usermodel.FontScheme;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFFont;
import org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder;
Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java Tue Oct 28 03:03:51 2008
@@ -17,9 +17,7 @@
package org.apache.poi.xssf.usermodel;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Font;
-import org.apache.poi.ss.usermodel.StylesSource;
+import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.model.StylesTable;
import org.apache.poi.xssf.usermodel.extensions.XSSFCellAlignment;
import org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder;
@@ -310,7 +308,7 @@
* Get the color to use for the bottom border
* <br/>
* Color is optional. When missing, IndexedColors.AUTOMATIC is implied.
- * @return the index of the color definition, default value is {@link IndexedColors.AUTOMATIC}
+ * @return the index of the color definition, default value is {@link org.apache.poi.ss.usermodel.IndexedColors.AUTOMATIC}
* @see IndexedColors
*/
public short getBottomBorderColor() {
@@ -664,7 +662,7 @@
* Set the type of horizontal alignment for the cell
*
* @param align - the type of alignment
- * @see HorizontalAlignment
+ * @see org.apache.poi.ss.usermodel.HorizontalAlignment
*/
public void setAlignment(HorizontalAlignment align) {
setAlignment((short)align.ordinal());
@@ -1192,7 +1190,7 @@
* Set the color to use for the top border
*
* @param color the index of the color definition
- * @see IndexedColors
+ * @see org.apache.poi.ss.usermodel.IndexedColors
*/
public void setTopBorderColor(short color) {
XSSFColor clr = new XSSFColor();
Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFComment.java Tue Oct 28 03:03:51 2008
@@ -17,7 +17,6 @@
package org.apache.poi.xssf.usermodel;
import org.apache.poi.ss.usermodel.Comment;
-import org.apache.poi.ss.usermodel.CommentsSource;
import org.apache.poi.ss.usermodel.RichTextString;
import org.apache.poi.xssf.usermodel.helpers.RichTextStringHelper;
import org.apache.poi.xssf.model.CommentsTable;
Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConnector.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConnector.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConnector.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConnector.java Tue Oct 28 03:03:51 2008
@@ -95,10 +95,10 @@
}
/**
- * Gets the shape type, one of the constants defined in {@link org.apache.poi.xssf.usermodel.ShapeTypes}.
+ * Gets the shape type, one of the constants defined in {@link org.apache.poi.ss.usermodel.ShapeTypes}.
*
* @return the shape type
- * @see org.apache.poi.xssf.usermodel.ShapeTypes
+ * @see org.apache.poi.ss.usermodel.ShapeTypes
*/
public int getShapeType() {
return ctShape.getSpPr().getPrstGeom().getPrst().intValue();
@@ -107,8 +107,8 @@
/**
* Sets the shape types.
*
- * @param type the shape type, one of the constants defined in {@link org.apache.poi.xssf.usermodel.ShapeTypes}.
- * @see org.apache.poi.xssf.usermodel.ShapeTypes
+ * @param type the shape type, one of the constants defined in {@link org.apache.poi.ss.usermodel.ShapeTypes}.
+ * @see org.apache.poi.ss.usermodel.ShapeTypes
*/
public void setShapeType(int type) {
ctShape.getSpPr().getPrstGeom().setPrst(STShapeType.Enum.forInt(type));
Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataFormat.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataFormat.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataFormat.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDataFormat.java Tue Oct 28 03:03:51 2008
@@ -17,7 +17,6 @@
package org.apache.poi.xssf.usermodel;
import org.apache.poi.ss.usermodel.DataFormat;
-import org.apache.poi.ss.usermodel.StylesSource;
import org.apache.poi.xssf.model.StylesTable;
/**
Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java Tue Oct 28 03:03:51 2008
@@ -39,6 +39,7 @@
* Root element of the SpreadsheetML Drawing part
*/
private CTDrawing drawing;
+ private boolean isNew;
/**
* Create a new SpreadsheetML drawing
@@ -48,6 +49,7 @@
protected XSSFDrawing() {
super();
drawing = newDrawing();
+ isNew = true;
}
/**
@@ -91,7 +93,7 @@
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing">
*/
- xmlOptions.setSaveSyntheticDocumentElement(new QName(CTDrawing.type.getName().getNamespaceURI(), "wsDr", "xdr"));
+ if(isNew) xmlOptions.setSaveSyntheticDocumentElement(new QName(CTDrawing.type.getName().getNamespaceURI(), "wsDr", "xdr"));
Map map = new HashMap();
map.put("http://schemas.openxmlformats.org/drawingml/2006/main", "a");
map.put(STRelationshipId.type.getName().getNamespaceURI(), "r");
Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationCell.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationCell.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationCell.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationCell.java Tue Oct 28 03:03:51 2008
@@ -32,7 +32,7 @@
public XSSFEvaluationCell(XSSFCell cell) {
_cell = cell;
- _evalSheet = new XSSFEvaluationSheet((XSSFSheet)cell.getSheet());
+ _evalSheet = new XSSFEvaluationSheet(cell.getSheet());
}
public XSSFEvaluationCell(XSSFCell cell, XSSFEvaluationSheet evaluationSheet) {
Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java Tue Oct 28 03:03:51 2008
@@ -75,7 +75,7 @@
public EvaluationName getName(String name) {
for(int i=0; i < _uBook.getNumberOfNames(); i++) {
- String nameText = _uBook.getNameName(i);
+ String nameText = _uBook.getNameAt(i).getNameName();
if (name.equalsIgnoreCase(nameText)) {
return new Name(_uBook.getNameAt(i), i, this);
}
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=708497&r1=708496&r2=708497&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 Tue Oct 28 03:03:51 2008
@@ -16,9 +16,7 @@
==================================================================== */
package org.apache.poi.xssf.usermodel;
-import java.util.ArrayList;
-
-import org.apache.poi.ss.usermodel.Font;
+import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.extensions.XSSFColor;
import org.apache.poi.xssf.model.StylesTable;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.*;
@@ -92,7 +90,7 @@
* get character-set to use.
*
* @return byte - character-set
- * @see FontCharset
+ * @see org.apache.poi.ss.usermodel.FontCharset
*/
public byte getCharSet() {
CTIntProperty charset = ctFont.sizeOfCharsetArray() == 0 ? null : ctFont.getCharsetArray(0);
@@ -233,7 +231,7 @@
* get type of text underlining to use
*
* @return byte - underlining type
- * @see FontUnderline
+ * @see org.apache.poi.ss.usermodel.FontUnderline
*/
public byte getUnderline() {
CTUnderlineProperty underline = ctFont.sizeOfUArray() == 0 ? null : ctFont.getUArray(0);
@@ -529,7 +527,7 @@
* get the font family to use.
*
* @return the font family to use
- * @see FontFamily
+ * @see org.apache.poi.ss.usermodel.FontFamily
*/
public int getFamily() {
CTIntProperty family = ctFont.sizeOfFamilyArray() == 0 ? ctFont.addNewFamily() : ctFont.getFamilyArray(0);
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=708497&r1=708496&r2=708497&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 Tue Oct 28 03:03:51 2008
@@ -17,7 +17,7 @@
package org.apache.poi.xssf.usermodel;
-import org.apache.poi.ss.usermodel.PrintSetup;
+import org.apache.poi.ss.usermodel.*;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.*;
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=708497&r1=708496&r2=708497&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 Tue Oct 28 03:03:51 2008
@@ -19,6 +19,7 @@
import java.io.IOException;
import java.io.OutputStream;
+import java.io.InputStream;
import java.util.*;
import javax.xml.namespace.QName;
@@ -110,12 +111,18 @@
@Override
protected void onDocumentRead() {
try {
- worksheet = WorksheetDocument.Factory.parse(getPackagePart().getInputStream()).getWorksheet();
- } catch (XmlException e){
- throw new POIXMLException(e);
+ read(getPackagePart().getInputStream());
} catch (IOException e){
throw new POIXMLException(e);
}
+ }
+
+ protected void read(InputStream is) throws IOException {
+ try {
+ worksheet = WorksheetDocument.Factory.parse(is).getWorksheet();
+ } catch (XmlException e){
+ throw new POIXMLException(e);
+ }
initRows(worksheet);
columnHelper = new ColumnHelper(worksheet);
@@ -1645,6 +1652,13 @@
@Override
protected void commit() throws IOException {
+ PackagePart part = getPackagePart();
+ OutputStream out = part.getOutputStream();
+ write(out);
+ out.close();
+ }
+
+ protected void write(OutputStream out) throws IOException {
if(worksheet.getColsArray().length == 1) {
CTCols col = worksheet.getColsArray(0);
@@ -1682,15 +1696,10 @@
XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
xmlOptions.setSaveSyntheticDocumentElement(new QName(CTWorksheet.type.getName().getNamespaceURI(), "worksheet"));
-
Map map = new HashMap();
map.put(STRelationshipId.type.getName().getNamespaceURI(), "r");
xmlOptions.setSaveSuggestedPrefixes(map);
- PackagePart part = getPackagePart();
- OutputStream out = part.getOutputStream();
worksheet.save(out, xmlOptions);
- out.close();
}
-
}
Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java Tue Oct 28 03:03:51 2008
@@ -23,7 +23,7 @@
/**
* Represents a shape with a predefined geometry in a SpreadsheetML drawing.
- * Possible shape types are defined in {@link ShapeTypes}
+ * Possible shape types are defined in {@link org.apache.poi.ss.usermodel.ShapeTypes}
*
* @author Yegor Kozlov
*/
@@ -109,10 +109,10 @@
}
/**
- * Gets the shape type, one of the constants defined in {@link ShapeTypes}.
+ * Gets the shape type, one of the constants defined in {@link org.apache.poi.ss.usermodel.ShapeTypes}.
*
* @return the shape type
- * @see ShapeTypes
+ * @see org.apache.poi.ss.usermodel.ShapeTypes
*/
public int getShapeType() {
return ctShape.getSpPr().getPrstGeom().getPrst().intValue();
@@ -121,8 +121,8 @@
/**
* Sets the shape types.
*
- * @param type the shape type, one of the constants defined in {@link ShapeTypes}.
- * @see ShapeTypes
+ * @param type the shape type, one of the constants defined in {@link org.apache.poi.ss.usermodel.ShapeTypes}.
+ * @see org.apache.poi.ss.usermodel.ShapeTypes
*/
public void setShapeType(int type) {
ctShape.getSpPr().getPrstGeom().setPrst(STShapeType.Enum.forInt(type));
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=708497&r1=708496&r2=708497&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 Tue Oct 28 03:03:51 2008
@@ -17,9 +17,7 @@
package org.apache.poi.xssf.usermodel;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.InputStream;
+import java.io.*;
import java.util.*;
import javax.xml.namespace.QName;
import org.apache.poi.POIXMLDocument;
@@ -102,7 +100,7 @@
*/
private List<XSSFPictureData> pictures;
- private static POILogger log = POILogFactory.getLogger(XSSFWorkbook.class);
+ private static POILogger logger = POILogFactory.getLogger(XSSFWorkbook.class);
/**
* Create a new SpreadsheetML workbook.
@@ -176,7 +174,7 @@
for (CTSheet ctSheet : this.workbook.getSheets().getSheetArray()) {
XSSFSheet sh = shIdMap.get(ctSheet.getId());
if(sh == null) {
- log.log(POILogger.WARN, "Sheet with name " + ctSheet.getName() + " and r:id " + ctSheet.getId()+ " was defined, but didn't exist in package, skipping");
+ logger.log(POILogger.WARN, "Sheet with name " + ctSheet.getName() + " and r:id " + ctSheet.getId()+ " was defined, but didn't exist in package, skipping");
continue;
}
sh.sheet = ctSheet;
@@ -303,29 +301,78 @@
return imageNumber - 1;
}
+ /**
+ * Create an XSSFSheet from an existing sheet in the XSSFWorkbook.
+ * The cloned sheet is a deep copy of the original.
+ *
+ * @return XSSFSheet representing the cloned sheet.
+ * @throws IllegalArgumentException if the sheet index in invalid
+ * @throws POIXMLException if there were errors when cloning
+ */
public XSSFSheet cloneSheet(int sheetNum) {
+ validateSheetIndex(sheetNum);
+
XSSFSheet srcSheet = sheets.get(sheetNum);
- String srcName = getSheetName(sheetNum);
- int i = 1;
- String name = srcName;
+ String srcName = srcSheet.getSheetName();
+ String clonedName = getUniqueSheetName(srcName);
+
+ XSSFSheet clonedSheet = createSheet(clonedName);
+ try {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ srcSheet.write(out);
+ clonedSheet.read(new ByteArrayInputStream(out.toByteArray()));
+ } catch (IOException e){
+ throw new POIXMLException("Failed to clone sheet", e);
+ }
+ CTWorksheet ct = clonedSheet.getCTWorksheet();
+ if(ct.isSetDrawing()) {
+ logger.log(POILogger.WARN, "Cloning sheets with drawings is not yet supported.");
+ ct.unsetDrawing();
+ }
+ if(ct.isSetLegacyDrawing()) {
+ logger.log(POILogger.WARN, "Cloning sheets with comments is not yet supported.");
+ ct.unsetLegacyDrawing();
+ }
+
+ clonedSheet.setSelected(false);
+ return clonedSheet;
+ }
+
+ /**
+ * Generate a valid sheet name based on the existing one. Used when cloning sheets.
+ *
+ * @param srcName the original sheet name to
+ * @return clone sheet name
+ */
+ private String getUniqueSheetName(String srcName) {
+ int uniqueIndex = 2;
+ String baseName = srcName;
+ int bracketPos = srcName.lastIndexOf('(');
+ if (bracketPos > 0 && srcName.endsWith(")")) {
+ String suffix = srcName.substring(bracketPos + 1, srcName.length() - ")".length());
+ try {
+ uniqueIndex = Integer.parseInt(suffix.trim());
+ uniqueIndex++;
+ baseName = srcName.substring(0, bracketPos).trim();
+ } catch (NumberFormatException e) {
+ // contents of brackets not numeric
+ }
+ }
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+")";
+ // Try and find the next sheet name that is unique
+ String index = Integer.toString(uniqueIndex++);
+ String name;
+ if (baseName.length() + index.length() + 2 < 31) {
+ name = baseName + " (" + index + ")";
} else {
- name = name.substring(0, 31 - index.length() - 2) + "(" +index + ")";
+ name = baseName.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 name;
}
}
-
- XSSFSheet clonedSheet = createSheet(name);
- clonedSheet.getCTWorksheet().set(srcSheet.getCTWorksheet());
- return clonedSheet;
}
/**
@@ -519,18 +566,6 @@
}
/**
- * Gets the Named range name at the given index number,
- * this method is equivalent to <code>getNameAt(index).getName()</code>
- *
- * @param index the named range index (0 based)
- * @return named range name
- * @see #getNameAt(int)
- */
- public String getNameName(int index) {
- return getNameAt(index).getNameName();
- }
-
- /**
* Gets the named range index by his name
* <i>Note:</i>Excel named ranges are case-insensitive and
* this method performs a case-insensitive search.
@@ -599,21 +634,6 @@
}
/**
- * deprecated May 2008
- * @deprecated - Misleading name - use getActiveSheetIndex()
- */
- public short getSelectedTab() {
- short i = 0;
- for (XSSFSheet sheet : this.sheets) {
- if (sheet.isSelected()) {
- return i;
- }
- ++i;
- }
- return -1;
- }
-
- /**
* Get sheet with the given name (case insensitive match)
*
* @param name of the sheet
Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellAlignment.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellAlignment.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellAlignment.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellAlignment.java Tue Oct 28 03:03:51 2008
@@ -19,8 +19,8 @@
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellAlignment;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STHorizontalAlignment;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STVerticalAlignment;
-import org.apache.poi.xssf.usermodel.HorizontalAlignment;
-import org.apache.poi.xssf.usermodel.VerticalAlignment;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
/**
Modified: poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellBorder.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellBorder.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellBorder.java (original)
+++ poi/branches/ooxml/src/ooxml/java/org/apache/poi/xssf/usermodel/extensions/XSSFCellBorder.java Tue Oct 28 03:03:51 2008
@@ -17,7 +17,7 @@
package org.apache.poi.xssf.usermodel.extensions;
-import org.apache.poi.xssf.usermodel.BorderStyle;
+import org.apache.poi.ss.usermodel.BorderStyle;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorderPr;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STBorderStyle;
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=708497&r1=708496&r2=708497&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 Tue Oct 28 03:03:51 2008
@@ -17,15 +17,16 @@
package org.apache.poi.xssf.usermodel;
-import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
+import org.apache.poi.ss.usermodel.IndexedColors;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.xssf.model.StylesTable;
import org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder;
import org.apache.poi.xssf.usermodel.extensions.XSSFCellFill;
import org.apache.poi.xssf.usermodel.extensions.XSSFColor;
-import org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder.BorderSide;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.*;
Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFont.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFont.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFont.java (original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFont.java Tue Oct 28 03:03:51 2008
@@ -2,11 +2,7 @@
import junit.framework.TestCase;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Font;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.XSSFTestDataSamples;
import org.apache.poi.xssf.usermodel.extensions.XSSFColor;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBooleanProperty;
Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPrintSetup.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPrintSetup.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPrintSetup.java (original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFPrintSetup.java Tue Oct 28 03:03:51 2008
@@ -20,6 +20,10 @@
import junit.framework.TestCase;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.*;
+import org.apache.poi.ss.usermodel.PaperSize;
+import org.apache.poi.ss.usermodel.PageOrder;
+import org.apache.poi.ss.usermodel.PrintOrientation;
+import org.apache.poi.ss.usermodel.PrintCellComments;
/**
* Tests for {@link XSSFPrintSetup}
Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java (original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java Tue Oct 28 03:03:51 2008
@@ -19,19 +19,13 @@
import java.io.File;
import java.io.FileOutputStream;
-import java.io.IOException;
import java.io.OutputStream;
import junit.framework.TestCase;
import org.apache.poi.hssf.HSSFTestDataSamples;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Font;
-import org.apache.poi.ss.usermodel.Name;
-import org.apache.poi.ss.usermodel.RichTextString;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.StylesSource;
-import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.XSSFTestDataSamples;
import org.apache.poi.xssf.model.StylesTable;
import org.openxml4j.opc.ContentTypes;
@@ -99,17 +93,6 @@
assertSame(sheet1, workbook.getSheetAt(0));
}
- public void testSetSelectedTab() {
- XSSFWorkbook workbook = new XSSFWorkbook();
- workbook.createSheet("sheet1");
- workbook.createSheet("sheet2");
- assertEquals(0, workbook.getSelectedTab());
- workbook.setSelectedTab((short) 0);
- assertEquals(0, workbook.getSelectedTab());
- workbook.setSelectedTab((short) 1);
- assertEquals(1, workbook.getSelectedTab());
- }
-
public void testSetSheetName() {
XSSFWorkbook workbook = new XSSFWorkbook();
workbook.createSheet("sheet1");
@@ -119,16 +102,32 @@
}
public void testCloneSheet() {
- XSSFWorkbook workbook = new XSSFWorkbook();
- workbook.createSheet("sheet");
- workbook.cloneSheet(0);
- assertEquals(2, workbook.getNumberOfSheets());
- assertEquals("sheet(1)", workbook.getSheetName(1));
- workbook.setSheetName(1, "clonedsheet");
- workbook.cloneSheet(1);
- assertEquals(3, workbook.getNumberOfSheets());
- assertEquals("clonedsheet(1)", workbook.getSheetName(2));
- }
+ XSSFWorkbook book = new XSSFWorkbook();
+ XSSFSheet sheet = book.createSheet("TEST");
+ sheet.createRow(0).createCell(0).setCellValue("Test");
+ sheet.createRow(1).createCell(0).setCellValue(36.6);
+ sheet.addMergedRegion(new CellRangeAddress(0, 1, 0, 2));
+ sheet.addMergedRegion(new CellRangeAddress(1, 2, 0, 2));
+ assertTrue(sheet.isSelected());
+
+ XSSFSheet clonedSheet = book.cloneSheet(0);
+ assertEquals("TEST (2)", clonedSheet.getSheetName());
+ assertEquals(2, clonedSheet.getPhysicalNumberOfRows());
+ assertEquals(2, clonedSheet.getNumMergedRegions());
+ assertFalse(clonedSheet.isSelected());
+
+ //cloned sheet is a deep copy, adding rows in the original does not affect the clone
+ sheet.createRow(2).createCell(0).setCellValue(1);
+ sheet.addMergedRegion(new CellRangeAddress(0, 2, 0, 2));
+ assertEquals(2, clonedSheet.getPhysicalNumberOfRows());
+ assertEquals(2, clonedSheet.getPhysicalNumberOfRows());
+
+ clonedSheet.createRow(2).createCell(0).setCellValue(1);
+ clonedSheet.addMergedRegion(new CellRangeAddress(0, 2, 0, 2));
+ assertEquals(3, clonedSheet.getPhysicalNumberOfRows());
+ assertEquals(3, clonedSheet.getPhysicalNumberOfRows());
+
+ }
public void testGetSheetByName() {
XSSFWorkbook workbook = new XSSFWorkbook();
@@ -209,19 +208,6 @@
nwb.setRepeatingRowsAndColumns(1, -1, -1, -1, -1);
-
- if (false) {
- // In case you fancy checking in excel, to ensure it
- // won't complain about the file now
- try {
- File tempFile = File.createTempFile("POI-45126-", ".xlsx");
- FileOutputStream fout = new FileOutputStream(tempFile);
- nwb.write(fout);
- fout.close();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
}
@@ -327,7 +313,6 @@
Font font=workbook.createFont();
((XSSFFont)font).setBold(true);
font.setUnderline(Font.U_DOUBLE);
- StylesTable styleSource=new StylesTable();
fontFind=workbook.findFont(Font.BOLDWEIGHT_BOLD, IndexedColors.BLACK.getIndex(), (short)15, "Calibri", false, false, Font.SS_NONE, Font.U_DOUBLE);
assertNull(fontFind);
}
@@ -440,8 +425,7 @@
StylesTable ss = workbook.getStylesSource();
assertNotNull(ss);
- assertTrue(ss instanceof StylesTable);
- StylesTable st = (StylesTable)ss;
+ StylesTable st = ss;
// Has 8 number formats
assertEquals(8, st._getNumberFormatSize());
@@ -467,9 +451,7 @@
ss = workbook.getStylesSource();
assertNotNull(ss);
- assertTrue(ss instanceof StylesTable);
- st = (StylesTable)ss;
-
+
assertEquals(10, st._getNumberFormatSize());
assertEquals(2, st._getFontsSize());
assertEquals(2, st._getFillsSize());
@@ -502,7 +484,7 @@
assertEquals("ForB3", workbook.getNameAt(1).getNameName());
assertEquals("B3 Comment", workbook.getNameAt(1).getComment());
- assertEquals("ForA2", workbook.getNameName(0));
+ assertEquals("ForA2", workbook.getNameAt(0).getNameName());
assertEquals(1, workbook.getNameIndex("ForB3"));
assertEquals(-1, workbook.getNameIndex("ForB3!!"));
Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFBorder.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFBorder.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFBorder.java (original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFBorder.java Tue Oct 28 03:03:51 2008
@@ -19,7 +19,7 @@
import junit.framework.TestCase;
-import org.apache.poi.xssf.usermodel.BorderStyle;
+import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder.BorderSide;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorderPr;
Modified: poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFCellFill.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFCellFill.java?rev=708497&r1=708496&r2=708497&view=diff
==============================================================================
--- poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFCellFill.java (original)
+++ poi/branches/ooxml/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFCellFill.java Tue Oct 28 03:03:51 2008
@@ -18,7 +18,6 @@
package org.apache.poi.xssf.usermodel.extensions;
-import org.apache.poi.xssf.usermodel.FillPatternType;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org