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 2008/04/02 01:53:54 UTC

svn commit: r643654 - /poi/trunk/src/java/org/apache/poi/hssf/record/DVRecord.java

Author: josh
Date: Tue Apr  1 16:53:51 2008
New Revision: 643654

URL: http://svn.apache.org/viewvc?rev=643654&view=rev
Log:
fix for bug 44710 - Incorrect skip() of second formula in DATAVALIDATION record

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/record/DVRecord.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/DVRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/DVRecord.java?rev=643654&r1=643653&r2=643654&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/DVRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/DVRecord.java Tue Apr  1 16:53:51 2008
@@ -28,7 +28,7 @@
 import org.apache.poi.util.StringUtil;
 
 /**
- * Title:        DV Record<P>
+ * Title:        DATAVALIDATION Record (0x01BE)<p/>
  * Description:  This record stores data validation settings and a list of cell ranges
  *               which contain these settings. The data validation settings of a sheet
  *               are stored in a sequential list of DV records. This list is followed by
@@ -36,7 +36,7 @@
  * @author Dragos Buleandra (dragos.buleandra@trade2b.ro)
  * @version 2.0-pre
  */
-public class DVRecord extends Record
+public final class DVRecord extends Record
 {
     public final static short sid = 0x01BE;
 
@@ -170,11 +170,6 @@
        this.field_not_used_1 = in.readShort();
 
        //read first formula data condition
-       // Not sure if this was needed or not...
-//       try {
-//    	   in.skip(this.field_size_first_formula);
-//       } catch(IOException e) { throw new IllegalStateException(e); } 
-
        int token_pos = 0;
        while (token_pos < this.field_size_first_formula)
        {
@@ -187,14 +182,14 @@
        this.field_not_used_2 = in.readShort();
 
        //read sec formula data condition
-       //Not sure if this was needed or not...
-       try {
-           in.skip(this.field_size_sec_formula);
-       } catch(IOException e) {
-           e.printStackTrace();
-           throw new IllegalStateException(e.getMessage());
+       if (false) { // TODO - prior to bug 44710 this 'skip' was being executed. write a junit to confirm this fix
+           try {
+               in.skip(this.field_size_sec_formula);
+           } catch(IOException e) {
+               e.printStackTrace();
+               throw new IllegalStateException(e.getMessage());
+           }
        }
-
        token_pos = 0;
        while (token_pos < this.field_size_sec_formula)
        {
@@ -516,7 +511,7 @@
 
     /**@todo DVRecord = Serializare */
 
-    private class StringHandler
+    private static final class StringHandler
     {
         private int     _string_length       = 0x0001;
         private byte    _string_unicode_flag = 0x00;



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