poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r709264 - /poi/trunk/src/java/org/apache/poi/hssf/record/
Date Thu, 30 Oct 2008 22:13:59 GMT
Author: josh
Date: Thu Oct 30 15:13:56 2008
New Revision: 709264

URL: http://svn.apache.org/viewvc?rev=709264&view=rev
Log:
Introduced Record.getDataSize() method

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/CRNRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/ExternSheetRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/ExternalNameRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/FormulaRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/ObjRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/PageBreakRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/Record.java
    poi/trunk/src/java/org/apache/poi/hssf/record/SelectionRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/StyleRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/SupBookRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java?rev=709264&r1=709263&r2=709264&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java Thu Oct 30 15:13:56
2008
@@ -156,7 +156,7 @@
 		return buffer.toString();
 	}
 	
-	private int getDataSize() {
+	protected int getDataSize() {
 		return 8 + field_5_sheetname.length() * (isMultibyte() ? 2 : 1);
 	}
 

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java?rev=709264&r1=709263&r2=709264&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java Thu Oct 30 15:13:56
2008
@@ -130,7 +130,7 @@
 		return buffer.toString();
 	}
 
-	private int getDataSize() {
+	protected int getDataSize() {
 		return 4 // 2 short fields
 			+ CellRangeAddress.ENCODED_SIZE
 			+ field_4_cell_ranges.getSize();

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/CRNRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/CRNRecord.java?rev=709264&r1=709263&r2=709264&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/CRNRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/CRNRecord.java Thu Oct 30 15:13:56 2008
@@ -63,7 +63,7 @@
 		sb.append("]");
 		return sb.toString();
 	}
-	private int getDataSize() {
+	protected int getDataSize() {
 		return 4 + ConstantValueParser.getEncodedSize(field_4_constant_values);
 	}
 

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/ExternSheetRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/ExternSheetRecord.java?rev=709264&r1=709263&r2=709264&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/ExternSheetRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/ExternSheetRecord.java Thu Oct 30 15:13:56
2008
@@ -153,8 +153,7 @@
 		return sb.toString();
 	}
 	
-	
-	private int getDataSize() {
+	protected int getDataSize() {
 		return 2 + _list.size() * RefSubRecord.ENCODED_SIZE;
 	}
 	

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/ExternalNameRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/ExternalNameRecord.java?rev=709264&r1=709263&r2=709264&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/ExternalNameRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/ExternalNameRecord.java Thu Oct 30 15:13:56
2008
@@ -83,7 +83,7 @@
 		return field_4_name;
 	}
 
-	private int getDataSize(){
+	protected int getDataSize(){
 		int result = 3 * 2  // 3 short fields
 			+ 2 + field_4_name.length(); // nameLen and name
 		if(hasFormula()) {

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/FormulaRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/FormulaRecord.java?rev=709264&r1=709263&r2=709264&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/FormulaRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/FormulaRecord.java Thu Oct 30 15:13:56 2008
@@ -353,7 +353,7 @@
 		return sid;
 	}
 
-	private int getDataSize() {
+	protected int getDataSize() {
 		return FIXED_SIZE + field_8_parsed_expr.getEncodedSize();
 	}
 	public int serialize(int offset, byte [] data) {

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/ObjRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/ObjRecord.java?rev=709264&r1=709263&r2=709264&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/ObjRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/ObjRecord.java Thu Oct 30 15:13:56 2008
@@ -119,7 +119,7 @@
 		return sb.toString();
 	}
 	
-	private int getDataSize() {
+	protected int getDataSize() {
 		if (_uninterpretedData != null) {
 			return _uninterpretedData.length;
 		}

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/PageBreakRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/PageBreakRecord.java?rev=709264&r1=709263&r2=709264&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/PageBreakRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/PageBreakRecord.java Thu Oct 30 15:13:56
2008
@@ -97,7 +97,7 @@
 
     }
 
-    private int getDataSize() {
+    protected int getDataSize() {
         return 2 + _breaks.size() * Break.ENCODED_SIZE;
     }
     public int getRecordSize() {

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/Record.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/Record.java?rev=709264&r1=709263&r2=709264&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/Record.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/Record.java Thu Oct 30 15:13:56 2008
@@ -55,6 +55,15 @@
     }
 
     /**
+     * @return the size of the data portion of this record 
+     * (does not include initial 4 bytes for sid and size)
+     */
+    protected int getDataSize() {
+    	// implementation is currently a hack
+    	// will eventually swap this out
+    	return getRecordSize() - 4;
+    }
+    /**
      * get a string representation of the record (for biffview/debugging)
      */
 

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/SelectionRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/SelectionRecord.java?rev=709264&r1=709263&r2=709264&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/SelectionRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/SelectionRecord.java Thu Oct 30 15:13:56
2008
@@ -143,7 +143,7 @@
         buffer.append("[/SELECTION]\n");
         return buffer.toString();
     }
-    private int getDataSize() {
+    protected int getDataSize() {
         return 9 // 1 byte + 4 shorts 
             + CellRangeAddress8Bit.getEncodedSize(field_6_refs.length);
     }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/StyleRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/StyleRecord.java?rev=709264&r1=709263&r2=709264&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/StyleRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/StyleRecord.java Thu Oct 30 15:13:56 2008
@@ -158,7 +158,7 @@
 	}
 
 	
-	private int getDataSize() {
+	protected int getDataSize() {
 		if (isBuiltin()) {
 			return 4; // short, byte, byte
 		}

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/SupBookRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/SupBookRecord.java?rev=709264&r1=709263&r2=709264&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/SupBookRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/SupBookRecord.java Thu Oct 30 15:13:56 2008
@@ -138,7 +138,7 @@
         sb.append("]");
         return sb.toString();
     }
-    private int getDataSize() {
+    protected int getDataSize() {
         if(!isExternalReferences()) {
             return SMALL_RECORD_SIZE;
         }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java?rev=709264&r1=709263&r2=709264&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/TextObjectRecord.java Thu Oct 30 15:13:56
2008
@@ -167,7 +167,7 @@
 	 * Only for the current record. does not include any subsequent Continue
 	 * records
 	 */
-	private int getDataSize() {
+	protected int getDataSize() {
 		int result = 2 + 2 + 2 + 2 + 2 + 2 + 2 + 4;
 		if (_linkRefPtg != null) {
 			result += 2 // formula size



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


Mime
View raw message