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

svn commit: r781623 - in /poi/trunk/src: java/org/apache/poi/hssf/dev/ java/org/apache/poi/hssf/usermodel/ java/org/apache/poi/ss/formula/ java/org/apache/poi/ss/usermodel/ testcases/org/apache/poi/hssf/usermodel/

Author: josh
Date: Thu Jun  4 00:06:31 2009
New Revision: 781623

URL: http://svn.apache.org/viewvc?rev=781623&view=rev
Log:
rolling back r781622

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFName.java
    poi/trunk/src/java/org/apache/poi/ss/formula/FormulaParser.java
    poi/trunk/src/java/org/apache/poi/ss/usermodel/Cell.java
    poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFName.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java?rev=781623&r1=781622&r2=781623&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java Thu Jun  4 00:06:31 2009
@@ -155,7 +155,6 @@
 			case EndRecord.sid:            return new EndRecord(in);
 			case ExtSSTRecord.sid:         return new ExtSSTRecord(in);
 			case ExtendedFormatRecord.sid: return new ExtendedFormatRecord(in);
-			case ExternalNameRecord.sid:   return new ExternalNameRecord(in);
 			case ExternSheetRecord.sid:    return new ExternSheetRecord(in);
 			case FilePassRecord.sid:       return new FilePassRecord(in);
 			case FileSharingRecord.sid:    return new FileSharingRecord(in);
@@ -359,7 +358,6 @@
 	 *
 	 */
 	public static void main(String[] args) {
-		args = new String[] { "--out", "c:/josh/temp/ex47199-23710-twoPSBs-x.xls", };
 
 		CommandArgs cmdArgs;
 		try {

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFName.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFName.java?rev=781623&r1=781622&r2=781623&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFName.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFName.java Thu Jun  4 00:06:31 2009
@@ -21,10 +21,8 @@
 import org.apache.poi.hssf.model.Workbook;
 import org.apache.poi.hssf.record.NameRecord;
 import org.apache.poi.hssf.record.formula.Ptg;
-import org.apache.poi.ss.SpreadsheetVersion;
 import org.apache.poi.ss.formula.FormulaType;
 import org.apache.poi.ss.usermodel.Name;
-import org.apache.poi.ss.util.CellReference;
 
 /**
  * High Level Representation of a 'defined name' which could be a 'built-in' name,
@@ -135,37 +133,13 @@
         }
     }
 
-    static void validateName(String name){
-        if(name.length() == 0) {
-			throw new IllegalArgumentException("Name cannot be blank");
-		}
+    private static void validateName(String name){
+        if(name.length() == 0)  throw new IllegalArgumentException("Name cannot be blank");
         
         char c = name.charAt(0);
         if(!(c == '_' || Character.isLetter(c)) || name.indexOf(' ') != -1) {
             throw new IllegalArgumentException("Invalid name: '"+name+"'; Names must begin with a letter or underscore and not contain spaces");
         }
-        if (true) {
-        	return;
-        }
-        int looksLikeType = CellReference.classifyCellReference(name, SpreadsheetVersion.EXCEL97);
-        String looksLikeStr;
-        switch (looksLikeType) {
-        	case CellReference.NameType.NAMED_RANGE:
-        		// all OK
-        		return;
-        	case CellReference.NameType.CELL:
-        		looksLikeStr = "cell reference";
-        		break;
-        	case CellReference.NameType.COLUMN:
-        		looksLikeStr = "column reference";
-        		break;
-        	default:
-        		looksLikeStr = null;
-        }
-		if (looksLikeType != CellReference.NameType.NAMED_RANGE) {
-        	throw new IllegalArgumentException("Specified name '" + name + "' is invalid"
-        			+ (looksLikeStr == null ? "" : " because it looks like a " + looksLikeStr));
-        }
     }
 
     /**

Modified: poi/trunk/src/java/org/apache/poi/ss/formula/FormulaParser.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/FormulaParser.java?rev=781623&r1=781622&r2=781623&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/FormulaParser.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/FormulaParser.java Thu Jun  4 00:06:31 2009
@@ -557,7 +557,7 @@
 		// which will either be named ranges or functions
 		StringBuilder sb = new StringBuilder();
 
-		if (!isValidDefinedNameChar(look)) {
+		if (!Character.isLetter(look)) {
 			throw expected("number, string, or defined name");
 		}
 		while (isValidDefinedNameChar(look)) {

Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/Cell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/Cell.java?rev=781623&r1=781622&r2=781623&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/Cell.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/Cell.java Thu Jun  4 00:06:31 2009
@@ -149,19 +149,11 @@
     void setCellValue(double value);
 
     /**
-     * Converts the supplied date to its equivalent Excel numeric value and sets
-     * that into the cell.
-     * <p/>
-     * <b>Note</b> - There is actually no 'DATE' cell type in Excel. In many
-     * cases (when entering date values), Excel automatically adjusts the
-     * <i>cell style</i> to some date format, creating the illusion that the cell
-     * data type is now something besides {@link Cell#CELL_TYPE_NUMERIC}.  POI
-     * does not attempt to replicate this behaviour.  To make a numeric cell
-     * display as a date, use {@link #setCellStyle(CellStyle)} etc.
-     * 
-     * @param value the numeric value to set this cell to.  For formulas we'll set the
-     *        precalculated value, for numerics we'll set its value. For other types we
-     *        will change the cell to a numerics cell and set its value.
+     * Set a boolean value for the cell
+     *
+     * @param value the boolean value to set this cell to.  For formulas we'll set the
+     *        precalculated value, for booleans we'll set its value. For other types we
+     *        will change the cell to a boolean cell and set its value.
      */
     void setCellValue(Date value);
 

Modified: poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java?rev=781623&r1=781622&r2=781623&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/usermodel/Sheet.java Thu Jun  4 00:06:31 2009
@@ -406,8 +406,8 @@
     PrintSetup getPrintSetup();
 
     /**
-     * Gets the user model for the default document header.  If it does not exist, the footer will
-     * be created. See {@link #hasHeader()} and {@link #removeHeader()}. <br/>
+     * Gets the user model for the default document header.
+     * <p>
      * Note that XSSF offers more kinds of document headers than HSSF does
      * </p>
      * @return the document header.
@@ -415,33 +415,12 @@
     Header getHeader();
 
     /**
-     * @return <code>true</code> if this sheet has a header 
-     */
-//    boolean hasHeader();
-
-    /**
-     * Removes the header if it exists. If it does not exist, this method does nothing.
-     */
-//    void removeHeader();
-
-    /**
-     * Gets the user model for the default document footer.  If it does not exist, the footer will
-     * be created. See {@link #hasFooter()} and {@link #removeFooter()}. <br/>
+     * Gets the user model for the default document footer.
      * Note that XSSF offers more kinds of document footers than HSSF does.
      *
      * @return the document footer.
      */
     Footer getFooter();
-    
-    /**
-     * @return <code>true</code> if this sheet has a footer 
-     */
-//    boolean hasFooter();
-
-    /**
-     * Removes the footer if it exists. If it does not exist, this method does nothing.
-     */
-//    void removeFooter();
 
     /**
      * Sets a flag indicating whether this sheet is selected.

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFName.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFName.java?rev=781623&r1=781622&r2=781623&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFName.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFName.java Thu Jun  4 00:06:31 2009
@@ -29,7 +29,6 @@
 import org.apache.poi.hssf.record.formula.Ptg;
 import org.apache.poi.ss.formula.FormulaType;
 import org.apache.poi.ss.usermodel.BaseTestNamedRange;
-import org.apache.poi.ss.usermodel.Name;
 import org.apache.poi.ss.util.AreaReference;
 
 /**
@@ -251,11 +250,6 @@
         for (int i = 0; i < ptgs.length; i++) {
             assertEquals('R', ptgs[i].getRVAType());
         }
+
     }
-    
-    public void testValidNames() {
-    	Name n = getTestDataProvider().createWorkbook().createName();
-		n.setNameName("B00000001");
-		
-	}
 }
\ No newline at end of file



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