Author: yegor
Date: Fri Jan 25 09:25:30 2008
New Revision: 615279

URL: http://svn.apache.org/viewvc?rev=615279&view=rev
Log:
merged with trunk r615269

Added:
    
poi/tags/REL_3_0_2_BETA3/src/testcases/org/apache/poi/hssf/data/SimpleWithChoose.xls
      - copied unchanged from r615267, 
poi/trunk/src/testcases/org/apache/poi/hssf/data/SimpleWithChoose.xls
    
poi/tags/REL_3_0_2_BETA3/src/testcases/org/apache/poi/hssf/record/formula/TestAreaPtg.java
      - copied unchanged from r615267, 
poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/TestAreaPtg.java
Modified:
    poi/tags/REL_3_0_2_BETA3/src/documentation/content/xdocs/changes.xml
    poi/tags/REL_3_0_2_BETA3/src/documentation/content/xdocs/status.xml
    
poi/tags/REL_3_0_2_BETA3/src/java/org/apache/poi/hssf/record/formula/AreaPtg.java
    
poi/tags/REL_3_0_2_BETA3/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java

Modified: poi/tags/REL_3_0_2_BETA3/src/documentation/content/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/poi/tags/REL_3_0_2_BETA3/src/documentation/content/xdocs/changes.xml?rev=615279&r1=615278&r2=615279&view=diff
==============================================================================
--- poi/tags/REL_3_0_2_BETA3/src/documentation/content/xdocs/changes.xml 
(original)
+++ poi/tags/REL_3_0_2_BETA3/src/documentation/content/xdocs/changes.xml Fri 
Jan 25 09:25:30 2008
@@ -36,6 +36,7 @@
 
                <!-- Don't forget to update status.xml too! -->
         <release version="3.0.2-FINAL" date="2008-??-??">
+            <action dev="POI-DEVELOPERS" type="fix">44293 - Avoid swapping 
AreaPtgs from relative to absolute</action>
             <action dev="POI-DEVELOPERS" type="fix">44292 - Correctly process 
the last paragraph in a word file</action>
             <action dev="POI-DEVELOPERS" type="fix">44254 - Avoid some unread 
byte warnings, and properly understand DVALRecord</action>
             <action dev="POI-DEVELOPERS" type="add">Add another formula 
evaluation method, evaluateFormulaCell(cell), which will re-calculate the value 
for a formula, without affecting the formula itself.</action>

Modified: poi/tags/REL_3_0_2_BETA3/src/documentation/content/xdocs/status.xml
URL: 
http://svn.apache.org/viewvc/poi/tags/REL_3_0_2_BETA3/src/documentation/content/xdocs/status.xml?rev=615279&r1=615278&r2=615279&view=diff
==============================================================================
--- poi/tags/REL_3_0_2_BETA3/src/documentation/content/xdocs/status.xml 
(original)
+++ poi/tags/REL_3_0_2_BETA3/src/documentation/content/xdocs/status.xml Fri Jan 
25 09:25:30 2008
@@ -33,6 +33,7 @@
        <!-- Don't forget to update changes.xml too! -->
     <changes>
         <release version="3.0.2-FINAL" date="2008-??-??">
+            <action dev="POI-DEVELOPERS" type="fix">44293 - Avoid swapping 
AreaPtgs from relative to absolute</action>
             <action dev="POI-DEVELOPERS" type="fix">44292 - Correctly process 
the last paragraph in a word file</action>
             <action dev="POI-DEVELOPERS" type="fix">44254 - Avoid some unread 
byte warnings, and properly understand DVALRecord</action>
             <action dev="POI-DEVELOPERS" type="add">Add another formula 
evaluation method, evaluateFormulaCell(cell), which will re-calculate the value 
for a formula, without affecting the formula itself.</action>

Modified: 
poi/tags/REL_3_0_2_BETA3/src/java/org/apache/poi/hssf/record/formula/AreaPtg.java
URL: 
http://svn.apache.org/viewvc/poi/tags/REL_3_0_2_BETA3/src/java/org/apache/poi/hssf/record/formula/AreaPtg.java?rev=615279&r1=615278&r2=615279&view=diff
==============================================================================
--- 
poi/tags/REL_3_0_2_BETA3/src/java/org/apache/poi/hssf/record/formula/AreaPtg.java
 (original)
+++ 
poi/tags/REL_3_0_2_BETA3/src/java/org/apache/poi/hssf/record/formula/AreaPtg.java
 Fri Jan 25 09:25:30 2008
@@ -43,9 +43,9 @@
     private short             field_3_first_column;
     private short             field_4_last_column;
     
-    private BitField         rowRelative = BitFieldFactory.getInstance(0x8000);
-    private BitField         colRelative = BitFieldFactory.getInstance(0x4000);
-    private BitField         column      = BitFieldFactory.getInstance(0x3FFF);
+    private final static BitField   rowRelative = 
BitFieldFactory.getInstance(0x8000);
+    private final static BitField   colRelative = 
BitFieldFactory.getInstance(0x4000);
+    private final static BitField   columnMask      = 
BitFieldFactory.getInstance(0x3FFF);
 
     protected AreaPtg() {
       //Required for clone methods
@@ -157,7 +157,7 @@
      */
     public short getFirstColumn()
     {
-        return column.getShortValue(field_3_first_column);
+        return columnMask.getShortValue(field_3_first_column);
     }
 
     /**
@@ -204,7 +204,7 @@
      */
     public void setFirstColumn(short column)
     {
-        field_3_first_column = column;   // fixme
+       field_3_first_column=columnMask.setShortValue(field_3_first_column, 
column);
     }
 
     /**
@@ -220,7 +220,7 @@
      */
     public short getLastColumn()
     {
-        return column.getShortValue(field_4_last_column);
+        return columnMask.getShortValue(field_4_last_column);
     }
 
     /**
@@ -269,7 +269,7 @@
      */
     public void setLastColumn(short column)
     {
-        field_4_last_column = column;   // fixme
+       field_4_last_column=columnMask.setShortValue(field_4_last_column, 
column);
     }
 
     /**

Modified: 
poi/tags/REL_3_0_2_BETA3/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
URL: 
http://svn.apache.org/viewvc/poi/tags/REL_3_0_2_BETA3/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java?rev=615279&r1=615278&r2=615279&view=diff
==============================================================================
--- 
poi/tags/REL_3_0_2_BETA3/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
 (original)
+++ 
poi/tags/REL_3_0_2_BETA3/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
 Fri Jan 25 09:25:30 2008
@@ -1008,9 +1008,27 @@
 
         wb = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
         assertTrue("No Exceptions while reading file", true);
-
     }
 
+       /**
+        * Bug 42618: RecordFormatException reading a file containing
+        *      =CHOOSE(2,A2,A3,A4)
+        */
+    public void test42618() throws Exception {
+        FileInputStream in = new FileInputStream(new File(cwd, 
"SimpleWithChoose.xls"));
+        HSSFWorkbook wb = new HSSFWorkbook(in);
+        in.close();
+
+        assertTrue("No Exceptions while reading file", true);
+
+        //serialize and read again
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        wb.write(out);
+        out.close();
+
+        wb = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
+        assertTrue("No Exceptions while reading file", true);
+    }
 }
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to