poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r689435 [1/2] - in /poi/branches/ooxml: ./ src/contrib/src/org/apache/poi/hssf/usermodel/contrib/ src/documentation/content/xdocs/ src/java/org/apache/poi/hssf/dev/ src/java/org/apache/poi/hssf/eventusermodel/ src/java/org/apache/poi/hssf/e...
Date Wed, 27 Aug 2008 10:34:36 GMT
Author: nick
Date: Wed Aug 27 03:34:33 2008
New Revision: 689435

URL: http://svn.apache.org/viewvc?rev=689435&view=rev
Log:
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642565,642568-642570,642572-642573,642576-642736,642739-642877,642879,642881-642890,642892-642903,642905-642945,642947-643624,643626-643653,643655-643669,643671,643673-643830,643832-643833,643835-644342,644344-644472,644474-644508,644510-645347,645349-645351,645353-645559,645561-645565,645568-645951,645953-646193,646195-646311,646313-646404,646406-646665,646667-646853,646855-646869,646871-647151,647153-647185,647187-647277,647279-647566,647568-647573,647575,647578-647711,647714-647737,647739-647823,647825-648155,648157-648202,648204-648273,648275,648277-648302,648304-648333,648335-648588,648590-648622,648625-648673,648675-649141,649144,649146-649556,
 649558-649795,649799,649801-649910,649912-649913,649915-650128,650131-650132,650134-650137,650140-650914,650916-651991,651993-652284,652286-652287,652289,652291,652293-652297,652299-652328,652330-652425,652427-652445,652447-652560,652562-652933,652935,652937-652993,652995-653116,653118-653124,653126-653483,653487-653519,653522-653550,653552-653607,653609-653667,653669-653674,653676-653814,653817-653830,653832-653891,653893-653944,653946-654055,654057-654355,654357-654365,654367-654648,654651-655215,655217-655277,655279-655281,655283-655911,655913-656212,656214,656216-656251,656253-656698,656700-656756,656758-656892,656894-657135,657137-657165,657168-657179,657181-657354,657356-657357,657359-657701,657703-657874,657876-658032,658034-658284,658286,658288-658301,658303-658307,658309-658321,658323-658335,658337-658348,658351,658353-658832,658834-658983,658985,658987-659066,659068-659402,659404-659428,659430-659451,659453-659454,659456-659461,659463-659477,659479-659524,659526-65
 9571,659574,659576-660255,660257-660262,660264-660279,660281-660343,660345-660473,660475-660827,660829-660833,660835-660888,660890-663321,663323-663435,663437-663764,663766-663854,663856-664219,664221-664489,664494-664514,664516-668013,668015-668142,668144-668152,668154,668156-668256,668258,668260-669139,669141-669455,669457-669657,669659-669808,669810-670189,670191-671321,671323-672229,672231-672549,672551-672552,672554-672561,672563-672566,672568,672571-673049,673051-673852,673854-673862,673864-673986,673988-673996,673998-674347,674349-674890,674892-674910,674912-674936,674938-674952,674954-675078,675080-675085,675087-675217,675219-675660,675662-675670,675672-675716,675718-675726,675728-675733,675735-675775,675777-675782,675784,675786-675791,675794-675852,675854-676200,676202,676204,676206-676220,676222-676309,676311-676456,676458-676994,676996-677027,677030-677040,677042-677056,677058-677375,677377-677968,677970-677971,677973,677975-677994,677996-678286,678288-678538,6785
 40-680393,680395-680469,680471-680529,680531-680852,680854-681529,681531-681571,681573-682224,682226,682228,682231-682281,682283-682335,682337-682507,682509,682512-682517,682519-682532,682534-682619,682622-682777,682779-682998,683000-683019,683021-683022,683024-683080,683082-683092,683094-683095,683097-683127,683129-683131,683133-683166,683168-683698,683700-683705,683707-683757,683759-683787,683789-683870,683872-683879,683881-683900,683902-684066,684068-684074,684076-684222,684224-684254,684257-684281,684283-684286,684288-684292,684294-684298,684300-684301,684303-684308,684310-684317,684320,684323-684335,684337-684348,684350-684354,684356-684361,684363-684369,684371-684453,684455-684883,684885-684937,684940-684958,684960-684970,684972-684985,684987-685053,685055-685063,685065-685259,685261-685262,685264-685266,685268-685282,685285-686035,686037-686045,686047-686052,686054-686206,686208-686215,686217-686277,686279-686289,686291-686620,686622-686623,686626-686627,686629-686639
 ,686641-686843,686845-686976,686978-689430 via svnmerge from 
https://svn.apache.org/repos/asf/poi/trunk

........
  r687403 | nick | 2008-08-20 19:14:11 +0100 (Wed, 20 Aug 2008) | 1 line
  
  Make an initial start on hpbf code
........
  r687423 | nick | 2008-08-20 19:50:15 +0100 (Wed, 20 Aug 2008) | 1 line
  
  More HPBF stuff, and some tests
........
  r687429 | nick | 2008-08-20 20:40:05 +0100 (Wed, 20 Aug 2008) | 1 line
  
  Quill CONTENTS bits, and tests
........
  r687443 | nick | 2008-08-20 21:13:08 +0100 (Wed, 20 Aug 2008) | 1 line
  
  HPBF text extractor and unit tests
........
  r688426 | josh | 2008-08-23 23:47:51 +0100 (Sat, 23 Aug 2008) | 1 line
  
  Fix for bug 45672 - prevent MissingRecordAwareHSSFListener generating multiple LastCellOfRowDummyRecords when shared formulas are present
........
  r688642 | josh | 2008-08-25 08:56:37 +0100 (Mon, 25 Aug 2008) | 1 line
  
  JDK 1.4 fixes for new hpbf stuff. Some clean-up
........
  r688650 | josh | 2008-08-25 09:09:02 +0100 (Mon, 25 Aug 2008) | 1 line
  
  Initial support for evaluating external add-in functions like YEARFRAC
........
  r688655 | josh | 2008-08-25 09:30:54 +0100 (Mon, 25 Aug 2008) | 1 line
  
  Fix for bug 45682 - allow cloning of sheets with conditional formatting
........
  r688825 | josh | 2008-08-25 19:57:14 +0100 (Mon, 25 Aug 2008) | 1 line
  
  Fix for small bug introduced in c688655 - keep header field in sync with number of rules
........
  r688910 | josh | 2008-08-25 23:41:08 +0100 (Mon, 25 Aug 2008) | 1 line
  
  Replaced calls to deprecated versions of createCell(), getCell(), createRow(), and getRow(). (Changing short to int)
........

Added:
    poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/atp/
      - copied from r688910, poi/trunk/src/java/org/apache/poi/hssf/record/formula/atp/
    poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/atp/AnalysisToolPak.java
      - copied, changed from r688910, poi/trunk/src/java/org/apache/poi/hssf/record/formula/atp/AnalysisToolPak.java
    poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/atp/YearFrac.java
      - copied, changed from r688910, poi/trunk/src/java/org/apache/poi/hssf/record/formula/atp/YearFrac.java
    poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/atp/YearFracCalculator.java
      - copied unchanged from r688910, poi/trunk/src/java/org/apache/poi/hssf/record/formula/atp/YearFracCalculator.java
    poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/eval/NameXEval.java
      - copied unchanged from r688910, poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/NameXEval.java
    poi/branches/ooxml/src/scratchpad/src/org/apache/poi/hpbf/HPBFDocument.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/HPBFDocument.java
    poi/branches/ooxml/src/scratchpad/src/org/apache/poi/hpbf/extractor/
      - copied from r688910, poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/extractor/
    poi/branches/ooxml/src/scratchpad/src/org/apache/poi/hpbf/extractor/PublisherTextExtractor.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/extractor/PublisherTextExtractor.java
    poi/branches/ooxml/src/scratchpad/src/org/apache/poi/hpbf/model/
      - copied from r688910, poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/
    poi/branches/ooxml/src/scratchpad/src/org/apache/poi/hpbf/model/EscherDelayStm.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/EscherDelayStm.java
    poi/branches/ooxml/src/scratchpad/src/org/apache/poi/hpbf/model/EscherPart.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/EscherPart.java
    poi/branches/ooxml/src/scratchpad/src/org/apache/poi/hpbf/model/EscherStm.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/EscherStm.java
    poi/branches/ooxml/src/scratchpad/src/org/apache/poi/hpbf/model/HPBFPart.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/HPBFPart.java
    poi/branches/ooxml/src/scratchpad/src/org/apache/poi/hpbf/model/MainContents.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/MainContents.java
    poi/branches/ooxml/src/scratchpad/src/org/apache/poi/hpbf/model/QuillContents.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/QuillContents.java
    poi/branches/ooxml/src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/
      - copied from r688910, poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/
    poi/branches/ooxml/src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/QCBit.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/QCBit.java
    poi/branches/ooxml/src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/QCTextBit.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/QCTextBit.java
    poi/branches/ooxml/src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/UnknownQCBit.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/UnknownQCBit.java
    poi/branches/ooxml/src/scratchpad/testcases/org/apache/poi/hpbf/TestHPBFDocument.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/testcases/org/apache/poi/hpbf/TestHPBFDocument.java
    poi/branches/ooxml/src/scratchpad/testcases/org/apache/poi/hpbf/data/Simple.pub
      - copied unchanged from r688910, poi/trunk/src/scratchpad/testcases/org/apache/poi/hpbf/data/Simple.pub
    poi/branches/ooxml/src/scratchpad/testcases/org/apache/poi/hpbf/extractor/
      - copied from r688910, poi/trunk/src/scratchpad/testcases/org/apache/poi/hpbf/extractor/
    poi/branches/ooxml/src/scratchpad/testcases/org/apache/poi/hpbf/extractor/TextPublisherTextExtractor.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/testcases/org/apache/poi/hpbf/extractor/TextPublisherTextExtractor.java
    poi/branches/ooxml/src/scratchpad/testcases/org/apache/poi/hpbf/model/
      - copied from r688910, poi/trunk/src/scratchpad/testcases/org/apache/poi/hpbf/model/
    poi/branches/ooxml/src/scratchpad/testcases/org/apache/poi/hpbf/model/TestEscherParts.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/testcases/org/apache/poi/hpbf/model/TestEscherParts.java
    poi/branches/ooxml/src/scratchpad/testcases/org/apache/poi/hpbf/model/TestQuillContents.java
      - copied unchanged from r688910, poi/trunk/src/scratchpad/testcases/org/apache/poi/hpbf/model/TestQuillContents.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/data/ex45672.xls
      - copied unchanged from r688910, poi/trunk/src/testcases/org/apache/poi/hssf/data/ex45672.xls
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/data/yearfracExamples.xls
      - copied unchanged from r688910, poi/trunk/src/testcases/org/apache/poi/hssf/data/yearfracExamples.xls
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/atp/
      - copied from r688910, poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/atp/
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/atp/TestYearFracCalculator.java
      - copied unchanged from r688910, poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/atp/TestYearFracCalculator.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/atp/TestYearFracCalculatorFromSpreadsheet.java
      - copied unchanged from r688910, poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/atp/TestYearFracCalculatorFromSpreadsheet.java
Modified:
    poi/branches/ooxml/   (props changed)
    poi/branches/ooxml/src/contrib/src/org/apache/poi/hssf/usermodel/contrib/HSSFCellUtil.java
    poi/branches/ooxml/src/documentation/content/xdocs/changes.xml
    poi/branches/ooxml/src/documentation/content/xdocs/status.xml
    poi/branches/ooxml/src/java/org/apache/poi/hssf/dev/HSSF.java
    poi/branches/ooxml/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java
    poi/branches/ooxml/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java
    poi/branches/ooxml/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java
    poi/branches/ooxml/src/java/org/apache/poi/hssf/record/SupBookRecord.java
    poi/branches/ooxml/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java
    poi/branches/ooxml/src/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java
    poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/NameXPtg.java
    poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/eval/ExternalFunction.java
    poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.java
    poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
    poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
    poi/branches/ooxml/src/java/org/apache/poi/ss/usermodel/DateUtil.java
    poi/branches/ooxml/src/java/org/apache/poi/ss/usermodel/FormulaEvaluator.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/eventmodel/TestModelFactory.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/TestSSTRecord.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestAreaErrPtg.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestArrayPtg.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestErrPtg.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestExternalFunctionFormulas.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestIntersectionPtg.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestPercentPtg.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestRangePtg.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestReferencePtg.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestUnionPtg.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/function/TestReadMissingBuiltInFuncs.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestFormulas.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFCell.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFComment.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConditionalFormatting.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDateUtil.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFHyperlink.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFOptimiser.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPalette.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFSheet.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestReadWriteChart.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestSheetHiding.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestSheetShiftRows.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestUnicodeWorkbook.java
    poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java

Propchange: poi/branches/ooxml/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Aug 27 03:34:33 2008
@@ -1 +1 @@
-/poi/trunk:1-638784,638786-639486,639488-639601,639603-640056,640058-642562,642564-642566,642568-642574,642576-642736,642739-650914,650916-687331
+/poi/trunk:1-638784,638786-639486,639488-639601,639603-640056,640058-642562,642564-642566,642568-642574,642576-642736,642739-650914,650916-689430

Modified: poi/branches/ooxml/src/contrib/src/org/apache/poi/hssf/usermodel/contrib/HSSFCellUtil.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/contrib/src/org/apache/poi/hssf/usermodel/contrib/HSSFCellUtil.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/contrib/src/org/apache/poi/hssf/usermodel/contrib/HSSFCellUtil.java (original)
+++ poi/branches/ooxml/src/contrib/src/org/apache/poi/hssf/usermodel/contrib/HSSFCellUtil.java Wed Aug 27 03:34:33 2008
@@ -113,7 +113,7 @@
 
         if ( cell == null )
         {
-            cell = row.createCell( (short)column );
+            cell = row.createCell(column );
         }
         return cell;
     }

Modified: poi/branches/ooxml/src/documentation/content/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/documentation/content/xdocs/changes.xml?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/documentation/content/xdocs/changes.xml (original)
+++ poi/branches/ooxml/src/documentation/content/xdocs/changes.xml Wed Aug 27 03:34:33 2008
@@ -64,6 +64,9 @@
            <action dev="POI-DEVELOPERS" type="add">Created a common interface for handling Excel files, irrespective of if they are .xls or .xlsx</action>
         </release>
         <release version="3.1.1-alpha1" date="2008-??-??">
+           <action dev="POI-DEVELOPERS" type="fix">45682 - Fix for cloning of CFRecordsAggregate</action>
+           <action dev="POI-DEVELOPERS" type="add">Initial support for evaluating external add-in functions like YEARFRAC</action>
+           <action dev="POI-DEVELOPERS" type="fix">45672 - Fix for MissingRecordAwareHSSFListener to prevent multiple LastCellOfRowDummyRecords when shared formulas are present</action>
            <action dev="POI-DEVELOPERS" type="fix">45645 - Fix for HSSFSheet.autoSizeColumn() for widths exceeding Short.MAX_VALUE</action>
            <action dev="POI-DEVELOPERS" type="add">45623 - Support for additional HSSF header and footer fields, including bold and full file path</action>
            <action dev="POI-DEVELOPERS" type="add">45623 - Support stripping HSSF header and footer fields (eg page number) out of header and footer text if required</action>

Modified: poi/branches/ooxml/src/documentation/content/xdocs/status.xml
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/documentation/content/xdocs/status.xml?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/documentation/content/xdocs/status.xml (original)
+++ poi/branches/ooxml/src/documentation/content/xdocs/status.xml Wed Aug 27 03:34:33 2008
@@ -61,6 +61,9 @@
            <action dev="POI-DEVELOPERS" type="add">Created a common interface for handling Excel files, irrespective of if they are .xls or .xlsx</action>
         </release>
         <release version="3.1.1-alpha1" date="2008-??-??">
+           <action dev="POI-DEVELOPERS" type="fix">45682 - Fix for cloning of CFRecordsAggregate</action>
+           <action dev="POI-DEVELOPERS" type="add">Initial support for evaluating external add-in functions like YEARFRAC</action>
+           <action dev="POI-DEVELOPERS" type="fix">45672 - Fix for MissingRecordAwareHSSFListener to prevent multiple LastCellOfRowDummyRecords when shared formulas are present</action>
            <action dev="POI-DEVELOPERS" type="fix">45645 - Fix for HSSFSheet.autoSizeColumn() for widths exceeding Short.MAX_VALUE</action>
            <action dev="POI-DEVELOPERS" type="add">45623 - Support for additional HSSF header and footer fields, including bold and full file path</action>
            <action dev="POI-DEVELOPERS" type="add">45623 - Support stripping HSSF header and footer fields (eg page number) out of header and footer text if required</action>

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/dev/HSSF.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/dev/HSSF.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/dev/HSSF.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/dev/HSSF.java Wed Aug 27 03:34:33 2008
@@ -132,7 +132,7 @@
                 {
                     c.setCellStyle(cs);
                 }
-                c = r.createCell(( short ) (cellnum + 1),
+                c = r.createCell(cellnum + 1,
                                  HSSFCell.CELL_TYPE_STRING);
                 c.setCellValue(new HSSFRichTextString("TEST"));
                 s.setColumnWidth(( short ) (cellnum + 1),
@@ -347,7 +347,7 @@
                     sheet.removeRow(row);
                 }
                 HSSFRow  row  = sheet.getRow(39);
-                HSSFCell cell = row.getCell(( short ) 3);
+                HSSFCell cell = row.getCell(3);
 
                 cell.setCellType(HSSFCell.CELL_TYPE_STRING);
                 cell.setCellValue("MODIFIED CELL!!!!!");

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java Wed Aug 27 03:34:33 2008
@@ -17,22 +17,15 @@
 
 package org.apache.poi.hssf.eventusermodel;
 
-import org.apache.poi.hssf.eventusermodel.HSSFListener;
 import org.apache.poi.hssf.eventusermodel.dummyrecord.LastCellOfRowDummyRecord;
 import org.apache.poi.hssf.eventusermodel.dummyrecord.MissingCellDummyRecord;
 import org.apache.poi.hssf.eventusermodel.dummyrecord.MissingRowDummyRecord;
 import org.apache.poi.hssf.record.BOFRecord;
-import org.apache.poi.hssf.record.BlankRecord;
-import org.apache.poi.hssf.record.BoolErrRecord;
-import org.apache.poi.hssf.record.BoundSheetRecord;
-import org.apache.poi.hssf.record.FormulaRecord;
-import org.apache.poi.hssf.record.LabelRecord;
-import org.apache.poi.hssf.record.LabelSSTRecord;
+import org.apache.poi.hssf.record.CellValueRecordInterface;
 import org.apache.poi.hssf.record.NoteRecord;
-import org.apache.poi.hssf.record.NumberRecord;
-import org.apache.poi.hssf.record.RKRecord;
 import org.apache.poi.hssf.record.Record;
 import org.apache.poi.hssf.record.RowRecord;
+import org.apache.poi.hssf.record.SharedFormulaRecord;
 
 /**
  * <p>A HSSFListener which tracks rows and columns, and will
@@ -44,16 +37,16 @@
  *  file, or was skipped from being written as it was
  *  blank.
  */
-public class MissingRecordAwareHSSFListener implements HSSFListener {
+public final class MissingRecordAwareHSSFListener implements HSSFListener {
 	private HSSFListener childListener;
 	
 	// Need to have different counters for cell rows and
 	//  row rows, as you sometimes get a RowRecord in the
 	//  middle of some cells, and that'd break everything
-	private int lastRowRow = -1;
+	private int lastRowRow;
 	
-	private int lastCellRow = -1;
-	private int lastCellColumn = -1;
+	private int lastCellRow;
+	private int lastCellColumn;
 	
 	/**
 	 * Constructs a new MissingRecordAwareHSSFListener, which
@@ -62,128 +55,80 @@
 	 * @param listener The HSSFListener to pass records on to
 	 */
 	public MissingRecordAwareHSSFListener(HSSFListener listener) {
+		resetCounts();
 		childListener = listener;
 	}
 
 	public void processRecord(Record record) {
-		int thisRow = -1;
-		int thisColumn = -1;
-		
-		switch (record.getSid())
-        {
-            // the BOFRecord can represent either the beginning of a sheet or the workbook
-            case BOFRecord.sid:
-                BOFRecord bof = (BOFRecord) record;
-                if (bof.getType() == bof.TYPE_WORKBOOK)
-                {
-                	// Reset the row and column counts - new workbook
-                	lastRowRow = -1;
-                	lastCellRow = -1;
-                	lastCellColumn = -1;
-                    //System.out.println("Encountered workbook");
-                } else if (bof.getType() == bof.TYPE_WORKSHEET)
-                {
-                	// Reset the row and column counts - new sheet
-                	lastRowRow = -1;
-                	lastCellRow = -1;
-                	lastCellColumn = -1;
-                    //System.out.println("Encountered sheet reference");
-                }
-                break;
-            case BoundSheetRecord.sid:
-                BoundSheetRecord bsr = (BoundSheetRecord) record;
-                //System.out.println("New sheet named: " + bsr.getSheetname());
-                break;
-            case RowRecord.sid:
-                RowRecord rowrec = (RowRecord) record;
-                //System.out.println("Row " + rowrec.getRowNumber() + " found, first column at "
-                //        + rowrec.getFirstCol() + " last column at " + rowrec.getLastCol());
-                
-                // If there's a jump in rows, fire off missing row records
-                if(lastRowRow+1 < rowrec.getRowNumber()) {
-                	for(int i=(lastRowRow+1); i<rowrec.getRowNumber(); i++) {
-                		MissingRowDummyRecord dr = new MissingRowDummyRecord(i);
-                		childListener.processRecord(dr);
-                	}
-                }
-                
-                // Record this as the last row we saw
-                lastRowRow = rowrec.getRowNumber();
-                break;
-                
-                
-            // These are all the "cell" records
-                
-            case BlankRecord.sid:
-            	BlankRecord brec = (BlankRecord) record;
-                thisRow = brec.getRow();
-                thisColumn = brec.getColumn();
-                break;
-            case BoolErrRecord.sid:
-            	BoolErrRecord berec = (BoolErrRecord) record;
-                thisRow = berec.getRow();
-                thisColumn = berec.getColumn();
-                break;
-            case FormulaRecord.sid:
-            	FormulaRecord frec = (FormulaRecord) record;
-            	thisRow = frec.getRow();
-            	thisColumn = frec.getColumn();
-                break;
-            case LabelRecord.sid:
-            	LabelRecord lrec = (LabelRecord) record;
-                thisRow = lrec.getRow();
-                thisColumn = lrec.getColumn();
-                //System.out.println("Cell found containing String "
-                //        + " at row " + lrec.getRow() + " and column " + lrec.getColumn());
-                break;
-            case LabelSSTRecord.sid:
-            	LabelSSTRecord lsrec = (LabelSSTRecord) record;
-                thisRow = lsrec.getRow();
-                thisColumn = lsrec.getColumn();
-                //System.out.println("Cell found containing String "
-                //        + " at row " + lsrec.getRow() + " and column " + lsrec.getColumn());
-                break;
-            case NoteRecord.sid:
-            	NoteRecord nrec = (NoteRecord) record;
-            	thisRow = nrec.getRow();
-            	thisColumn = nrec.getColumn();
-                break;
-            case NumberRecord.sid:
-                NumberRecord numrec = (NumberRecord) record;
-                thisRow = numrec.getRow();
-                thisColumn = numrec.getColumn();
-                //System.out.println("Cell found with value " + numrec.getValue()
-                //        + " at row " + numrec.getRow() + " and column " + numrec.getColumn());
-                break;
-            case RKRecord.sid:
-            	RKRecord rkrec = (RKRecord) record;
-            	thisRow = rkrec.getRow();
-            	thisColumn = rkrec.getColumn();
-                break;
-            default:
-            	//System.out.println(record.getClass());
-            	break;
-        }
-		
+		int thisRow;
+		int thisColumn;
+
+
+		if (record instanceof CellValueRecordInterface) {
+			CellValueRecordInterface valueRec = (CellValueRecordInterface) record;
+			thisRow = valueRec.getRow();
+			thisColumn = valueRec.getColumn();
+		} else {
+			thisRow = -1;
+			thisColumn = -1;
+
+			switch (record.getSid()) {
+				// the BOFRecord can represent either the beginning of a sheet or
+				// the workbook
+				case BOFRecord.sid:
+					BOFRecord bof = (BOFRecord) record;
+					if (bof.getType() == bof.TYPE_WORKBOOK || bof.getType() == bof.TYPE_WORKSHEET) {
+						// Reset the row and column counts - new workbook / worksheet
+						resetCounts();
+					}
+					break;
+				case RowRecord.sid:
+					RowRecord rowrec = (RowRecord) record;
+					//System.out.println("Row " + rowrec.getRowNumber() + " found, first column at "
+					//        + rowrec.getFirstCol() + " last column at " + rowrec.getLastCol());
+
+					// If there's a jump in rows, fire off missing row records
+					if (lastRowRow + 1 < rowrec.getRowNumber()) {
+						for (int i = (lastRowRow + 1); i < rowrec.getRowNumber(); i++) {
+							MissingRowDummyRecord dr = new MissingRowDummyRecord(i);
+							childListener.processRecord(dr);
+						}
+					}
+
+					// Record this as the last row we saw
+					lastRowRow = rowrec.getRowNumber();
+					break;
+
+				case SharedFormulaRecord.sid:
+					// SharedFormulaRecord occurs after the first FormulaRecord of the cell range.
+					// There are probably (but not always) more cell records after this
+					// - so don't fire off the LastCellOfRowDummyRecord yet
+					childListener.processRecord(record);
+					return;
+				case NoteRecord.sid:
+					NoteRecord nrec = (NoteRecord) record;
+					thisRow = nrec.getRow();
+					thisColumn = nrec.getColumn();
+					break;
+			}
+		}
 		// If we're on cells, and this cell isn't in the same
 		//  row as the last one, then fire the 
-		//  dummy end-of-row records?
+		//  dummy end-of-row records
 		if(thisRow != lastCellRow && lastCellRow > -1) {
 			for(int i=lastCellRow; i<thisRow; i++) {
 				int cols = -1;
 				if(i == lastCellRow) {
 					cols = lastCellColumn;
 				}
-				LastCellOfRowDummyRecord r = new LastCellOfRowDummyRecord(i, cols);
-				childListener.processRecord(r);
+				childListener.processRecord(new LastCellOfRowDummyRecord(i, cols));
 			}
 		}
 		
 		// If we've just finished with the cells, then fire the
-		//  final dummy end-of-row record
+		// final dummy end-of-row record
 		if(lastCellRow != -1 && lastCellColumn != -1 && thisRow == -1) {
-			LastCellOfRowDummyRecord r = new LastCellOfRowDummyRecord(lastCellRow, lastCellColumn);
-			childListener.processRecord(r);
+			childListener.processRecord(new LastCellOfRowDummyRecord(lastCellRow, lastCellColumn));
 			
 			lastCellRow = -1;
 			lastCellColumn = -1;
@@ -196,11 +141,10 @@
 		}
 		
 		// If there's a gap in the cells, then fire
-		//  the dummy cell records?
-		if(lastCellColumn != (thisColumn-1)) {
+		//  the dummy cell records
+		if(lastCellColumn != thisColumn-1) {
 			for(int i=lastCellColumn+1; i<thisColumn; i++) {
-				MissingCellDummyRecord r = new MissingCellDummyRecord(thisRow, i);
-				childListener.processRecord(r);
+				childListener.processRecord(new MissingCellDummyRecord(thisRow, i));
 			}
 		}
 		
@@ -209,7 +153,13 @@
 			lastCellColumn = thisColumn;
 			lastCellRow = thisRow;
 		}
-		
+
 		childListener.processRecord(record);
 	}
+
+	private void resetCounts() {
+		lastRowRow = -1;
+		lastCellRow = -1;
+		lastCellColumn = -1;
+	}
 }

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java Wed Aug 27 03:34:33 2008
@@ -107,7 +107,7 @@
 				int firstCell = row.getFirstCellNum();
 				int lastCell = row.getLastCellNum();
 				for(int k=firstCell;k<lastCell;k++) {
-					HSSFCell cell = row.getCell((short)k);
+					HSSFCell cell = row.getCell(k);
 					boolean outputContents = false;
 					if(cell == null) { continue; }
 					

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java Wed Aug 27 03:34:33 2008
@@ -40,11 +40,11 @@
 	{
 		field_4_cell_ranges = new CellRangeAddressList();
 	}
-	public CFHeaderRecord(CellRangeAddress[] regions)
-	{
+	public CFHeaderRecord(CellRangeAddress[] regions, int nRules) {
 		CellRangeAddress[] unmergedRanges = regions;
 		CellRangeAddress[] mergeCellRanges = CellRangeUtil.mergeCellRanges(unmergedRanges);
 		setCellRanges(mergeCellRanges);
+		field_1_numcf = nRules;
 	}
 
 	public CFHeaderRecord(RecordInputStream in)

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/record/SupBookRecord.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/record/SupBookRecord.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/record/SupBookRecord.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/record/SupBookRecord.java Wed Aug 27 03:34:33 2008
@@ -150,6 +150,7 @@
             sb.append("Internal References ");
             sb.append(" nSheets= ").append(field_1_number_of_sheets);
         }
+        sb.append("]");
         return sb.toString();
     }
     private int getDataSize() {

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java Wed Aug 27 03:34:33 2008
@@ -18,14 +18,12 @@
 package org.apache.poi.hssf.record.aggregates;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.poi.hssf.model.RecordStream;
 import org.apache.poi.hssf.record.CFHeaderRecord;
 import org.apache.poi.hssf.record.CFRuleRecord;
 import org.apache.poi.hssf.record.Record;
-import org.apache.poi.hssf.record.RecordInputStream;
 import org.apache.poi.ss.util.Region;
 import org.apache.poi.ss.util.CellRangeAddress;
 
@@ -37,12 +35,10 @@
  * @author Dmitriy Kumshayev
  *
  */
-public final class CFRecordsAggregate extends Record {
+public final class CFRecordsAggregate extends RecordAggregate {
 	/** Excel allows up to 3 conditional formating rules */
 	private static final int MAX_CONDTIONAL_FORMAT_RULES = 3;
 
-	public final static short sid = -2008; // not a real BIFF record
-
 	private final CFHeaderRecord header;
 
 	/** List of CFRuleRecord objects */
@@ -59,6 +55,9 @@
 			throw new IllegalArgumentException("No more than " 
 					+ MAX_CONDTIONAL_FORMAT_RULES + " rules may be specified");
 		}
+		if (pRules.length != pHeader.getNumberOfConditionalFormats()) {
+			throw new RuntimeException("Mismatch number of rules");
+		}
 		header = pHeader;
 		rules = new ArrayList(3);
 		for (int i = 0; i < pRules.length; i++) {
@@ -67,7 +66,7 @@
 	}
 
 	public CFRecordsAggregate(CellRangeAddress[] regions, CFRuleRecord[] rules) {
-		this(new CFHeaderRecord(regions), rules);
+		this(new CFHeaderRecord(regions, rules.length), rules);
 	}
 
 	/**
@@ -108,45 +107,6 @@
 		return new CFRecordsAggregate((CFHeaderRecord) header.clone(), newRecs);
 	}
 
-	protected void fillFields(RecordInputStream in)
-	{
-	     // You never fill an aggregate record
-	}
-
-	public short getSid()
-	{
-		return sid;
-	}
-
-	/**
-	 * called by the class that is responsible for writing this sucker.
-	 * Subclasses should implement this so that their data is passed back in a
-	 * byte array.
-	 *
-	 * @param offset to begin writing at
-	 * @param data byte array containing instance data
-	 * @return number of bytes written
-	 */
-
-	public int serialize(int offset, byte[] data)
-	{
-		int nRules = rules.size();
-		header.setNumberOfConditionalFormats(nRules);
-
-		int pos = offset;
-
-		pos += header.serialize(pos, data);
-		for(int i=0; i< nRules; i++) {
-			pos += getRule(i).serialize(pos, data);
-		}
-		return pos - offset;
-	}
-
-	protected void validateSid(short id)
-	{
-		// do nothing here
-	}
-
 	/**
 	 * @return the header. Never <code>null</code>.
 	 */
@@ -166,10 +126,16 @@
 		return (CFRuleRecord) rules.get(idx);
 	}
 	public void setRule(int idx, CFRuleRecord r) {
+		if (r == null) {
+			throw new IllegalArgumentException("r must not be null");
+		}
 		checkRuleIndex(idx);
 		rules.set(idx, r);
 	}
 	public void addRule(CFRuleRecord r) {
+		if (r == null) {
+			throw new IllegalArgumentException("r must not be null");
+		}
 		if(rules.size() >= MAX_CONDTIONAL_FORMAT_RULES) {
 			throw new IllegalStateException("Cannot have more than " 
 					+ MAX_CONDTIONAL_FORMAT_RULES + " conditional format rules");
@@ -182,26 +148,6 @@
 	}
 
 	/**
-	 *  @return sum of sizes of all aggregated records
-	 */
-	public int getRecordSize() 
-	{
-		int size = 0;
-		if( header != null)
-		{
-			size += header.getRecordSize();
-		}
-		if( rules != null)
-		{
-			for(Iterator irecs = rules.iterator(); irecs.hasNext(); )
-			{
-				size += (( Record ) irecs.next()).getRecordSize();
-			}
-		}
-		return size;
-	}
-
-	/**
 	 * String representation of CFRecordsAggregate
 	 */
 	public String toString()
@@ -216,12 +162,17 @@
 		for(int i=0; i<rules.size(); i++)
 		{
 			CFRuleRecord cfRule = (CFRuleRecord)rules.get(i);
-			if(cfRule!=null)
-			{
-				buffer.append(cfRule.toString());
-			}
+			buffer.append(cfRule.toString());
 		}
 		buffer.append("[/CF]\n");
 		return buffer.toString();
 	}
+
+	public void visitContainedRecords(RecordVisitor rv) {
+		rv.visitRecord(header);
+		for(int i=0; i<rules.size(); i++) {
+			CFRuleRecord rule = (CFRuleRecord)rules.get(i);
+			rv.visitRecord(rule);
+		}
+	}
 }

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/record/aggregates/ConditionalFormattingTable.java Wed Aug 27 03:34:33 2008
@@ -22,7 +22,6 @@
 
 import org.apache.poi.hssf.model.RecordStream;
 import org.apache.poi.hssf.record.CFHeaderRecord;
-import org.apache.poi.hssf.record.Record;
 
 /**
  * Holds all the conditional formatting for a workbook sheet.<p/>
@@ -53,7 +52,8 @@
 
 	public void visitContainedRecords(RecordVisitor rv) {
 		for (int i = 0; i < _cfHeaders.size(); i++) {
-			rv.visitRecord((Record) _cfHeaders.get(i));
+			CFRecordsAggregate subAgg = (CFRecordsAggregate) _cfHeaders.get(i);
+			subAgg.visitContainedRecords(rv);
 		}
 	}
 

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/NameXPtg.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/NameXPtg.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/NameXPtg.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/NameXPtg.java Wed Aug 27 03:34:33 2008
@@ -30,11 +30,11 @@
 	private final static int SIZE = 7;
 
 	/** index to REF entry in externsheet record */
-	private int _sheetRefIndex;
+	private final int _sheetRefIndex;
 	/** index to defined name or externname table(1 based) */
-	private int _nameNumber;
+	private final int _nameNumber;
 	/** reserved must be 0 */
-	private int _reserved;
+	private final int _reserved;
 
 	private NameXPtg(int sheetRefIndex, int nameNumber, int reserved) {
 		_sheetRefIndex = sheetRefIndex;
@@ -73,4 +73,11 @@
 	public byte getDefaultOperandClass() {
 		return Ptg.CLASS_VALUE;
 	}
+
+	public int getSheetRefIndex() {
+		return _sheetRefIndex;
+	}
+	public int getNameIndex() {
+		return _nameNumber - 1;
+	}
 }

Copied: poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/atp/AnalysisToolPak.java (from r688910, poi/trunk/src/java/org/apache/poi/hssf/record/formula/atp/AnalysisToolPak.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/atp/AnalysisToolPak.java?p2=poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/atp/AnalysisToolPak.java&p1=poi/trunk/src/java/org/apache/poi/hssf/record/formula/atp/AnalysisToolPak.java&r1=688910&r2=689435&rev=689435&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/atp/AnalysisToolPak.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/atp/AnalysisToolPak.java Wed Aug 27 03:34:33 2008
@@ -24,15 +24,15 @@
 import org.apache.poi.hssf.record.formula.eval.Eval;
 import org.apache.poi.hssf.record.formula.eval.ValueEval;
 import org.apache.poi.hssf.record.formula.functions.FreeRefFunction;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 
 public final class AnalysisToolPak {
 
 	private static final FreeRefFunction NotImplemented = new FreeRefFunction() {
 
 		public ValueEval evaluate(Eval[] args, int srcCellRow, short srcCellCol,
-				HSSFWorkbook workbook, HSSFSheet sheet) {
+				Workbook workbook, Sheet sheet) {
 			return ErrorEval.FUNCTION_NOT_IMPLEMENTED;
 		}
 	};

Copied: poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/atp/YearFrac.java (from r688910, poi/trunk/src/java/org/apache/poi/hssf/record/formula/atp/YearFrac.java)
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/atp/YearFrac.java?p2=poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/atp/YearFrac.java&p1=poi/trunk/src/java/org/apache/poi/hssf/record/formula/atp/YearFrac.java&r1=688910&r2=689435&rev=689435&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/atp/YearFrac.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/atp/YearFrac.java Wed Aug 27 03:34:33 2008
@@ -29,9 +29,9 @@
 import org.apache.poi.hssf.record.formula.eval.StringEval;
 import org.apache.poi.hssf.record.formula.eval.ValueEval;
 import org.apache.poi.hssf.record.formula.functions.FreeRefFunction;
-import org.apache.poi.hssf.usermodel.HSSFDateUtil;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.DateUtil;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 /**
  * Implementation of Excel 'Analysis ToolPak' function YEARFRAC()<br/>
  * 
@@ -60,8 +60,8 @@
 		// enforce singleton
 	}
 
-	public ValueEval evaluate(Eval[] args, int srcCellRow, short srcCellCol, HSSFWorkbook workbook,
-			HSSFSheet sheet) {
+	public ValueEval evaluate(Eval[] args, int srcCellRow, short srcCellCol, Workbook workbook,
+			Sheet sheet) {
 
 		double result;
 		try {
@@ -94,7 +94,7 @@
 				return dVal.doubleValue();
 			}
 			Calendar date = parseDate(strVal);
-			return HSSFDateUtil.getExcelDate(date, false);
+			return DateUtil.getExcelDate(date, false);
 		}
 		return OperandResolver.coerceValueToDouble(ve);
 	}

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/eval/ExternalFunction.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/eval/ExternalFunction.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/eval/ExternalFunction.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/record/formula/eval/ExternalFunction.java Wed Aug 27 03:34:33 2008
@@ -17,14 +17,16 @@
 
 package org.apache.poi.hssf.record.formula.eval;
 
+import org.apache.poi.hssf.record.formula.atp.AnalysisToolPak;
 import org.apache.poi.hssf.record.formula.functions.FreeRefFunction;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
 /**
  * 
- * Common entry point for all external functions (where 
+ * Common entry point for all user-defined (non-built-in) functions (where 
  * <tt>AbstractFunctionPtg.field_2_fnc_index</tt> == 255)
  * 
+ * TODO rename to UserDefinedFunction
  * @author Josh Micich
  */
 final class ExternalFunction implements FreeRefFunction {
@@ -36,27 +38,43 @@
 			throw new RuntimeException("function name argument missing");
 		}
 		
-		if (!(args[0] instanceof NameEval)) {
-			throw new RuntimeException("First argument should be a NameEval, but got ("
-					+ args[0].getClass().getName() + ")");
-		}
-		NameEval functionNameEval = (NameEval) args[0];
-		
-		int nOutGoingArgs = nIncomingArgs -1;
-		Eval[] outGoingArgs = new Eval[nOutGoingArgs];
-		System.arraycopy(args, 1, outGoingArgs, 0, nOutGoingArgs);
-		
+		Eval nameArg = args[0];
 		FreeRefFunction targetFunc;
 		try {
-			targetFunc = findTargetFunction(workbook, functionNameEval);
+			if (nameArg instanceof NameEval) {
+				targetFunc = findInternalUserDefinedFunction(workbook, (NameEval) nameArg);
+			} else if (nameArg instanceof NameXEval) {
+				targetFunc = findExternalUserDefinedFunction(workbook, (NameXEval) nameArg);
+			} else {
+				throw new RuntimeException("First argument should be a NameEval, but got ("
+						+ nameArg.getClass().getName() + ")");
+			}
 		} catch (EvaluationException e) {
 			return e.getErrorEval();
 		}
-		
+		int nOutGoingArgs = nIncomingArgs -1;
+		Eval[] outGoingArgs = new Eval[nOutGoingArgs];
+		System.arraycopy(args, 1, outGoingArgs, 0, nOutGoingArgs);
 		return targetFunc.evaluate(outGoingArgs, srcCellRow, srcCellCol, workbook, sheet);
 	}
 
-	private FreeRefFunction findTargetFunction(Workbook workbook, NameEval functionNameEval) throws EvaluationException {
+	private FreeRefFunction findExternalUserDefinedFunction(Workbook workbook,
+			NameXEval n) throws EvaluationException {
+		String functionName = workbook.resolveNameXText(n.getSheetRefIndex(), n.getNameNumber());
+
+		if(false) {
+			System.out.println("received call to external user defined function (" + functionName + ")");
+		}
+		// currently only looking for functions from the 'Analysis TookPak'
+		// not sure how much this logic would need to change to support other or multiple add-ins.
+		FreeRefFunction result = AnalysisToolPak.findFunction(functionName);
+		if (result != null) {
+			return result;
+		}
+		throw new EvaluationException(ErrorEval.FUNCTION_NOT_IMPLEMENTED);
+	}
+
+	private FreeRefFunction findInternalUserDefinedFunction(Workbook workbook, NameEval functionNameEval) throws EvaluationException {
 
 		int numberOfNames = workbook.getNumberOfNames();
 		
@@ -68,7 +86,7 @@
 		
 		String functionName = workbook.getNameName(nameIndex);
 		if(false) {
-			System.out.println("received call to external function index (" + functionName + ")");
+			System.out.println("received call to internal user defined function  (" + functionName + ")");
 		}
 		// TODO - detect if the NameRecord corresponds to a named range, function, or something undefined
 		// throw the right errors in these cases
@@ -77,5 +95,5 @@
 		
 		throw new EvaluationException(ErrorEval.FUNCTION_NOT_IMPLEMENTED);
 	}
-
 }
+

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.java Wed Aug 27 03:34:33 2008
@@ -41,6 +41,12 @@
 	private final HSSFWorkbook workbook;
 
 	HSSFConditionalFormattingRule(HSSFWorkbook pWorkbook, CFRuleRecord pRuleRecord) {
+		if (pWorkbook == null) {
+			throw new IllegalArgumentException("pWorkbook must not be null");
+		}
+		if (pRuleRecord == null) {
+			throw new IllegalArgumentException("pRuleRecord must not be null");
+		}
 		workbook = pWorkbook;
 		cfRuleRecord = pRuleRecord;
 	}

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java Wed Aug 27 03:34:33 2008
@@ -349,7 +349,7 @@
         }
         if(policy == CREATE_NULL_AS_BLANK) {
             if(cell == null) {
-                return createCell((short)cellnum, HSSFCell.CELL_TYPE_BLANK);
+                return createCell(cellnum, HSSFCell.CELL_TYPE_BLANK);
             }
             return cell;
         }

Modified: poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java Wed Aug 27 03:34:33 2008
@@ -1836,7 +1836,7 @@
         //  new HSSFComment instances, which is bad
         HSSFRow r = getRow(row);
         if(r != null) {
-            HSSFCell c = r.getCell((short)column);
+            HSSFCell c = r.getCell(column);
             if(c != null) {
                 return c.getCellComment();
             } else {

Modified: poi/branches/ooxml/src/java/org/apache/poi/ss/usermodel/DateUtil.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/ss/usermodel/DateUtil.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/ss/usermodel/DateUtil.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/ss/usermodel/DateUtil.java Wed Aug 27 03:34:33 2008
@@ -158,9 +158,16 @@
         if (!isValidExcelDate(date)) {
             return null;
         }
+        int wholeDays = (int)Math.floor(date);
+        int millisecondsInDay = (int)((date - wholeDays) * DAY_MILLISECONDS + 0.5);
+        Calendar calendar = new GregorianCalendar(); // using default time-zone
+        setCalendar(calendar, wholeDays, millisecondsInDay, use1904windowing);
+        return calendar.getTime();
+    }        
+    public static void setCalendar(Calendar calendar, int wholeDays, 
+            int millisecondsInDay, boolean use1904windowing) {
         int startYear = 1900;
         int dayAdjust = -1; // Excel thinks 2/29/1900 is a valid date, which it isn't
-        int wholeDays = (int)Math.floor(date);
         if (use1904windowing) {
             startYear = 1904;
             dayAdjust = 1; // 1904 date windowing uses 1/2/1904 as the first day
@@ -170,12 +177,8 @@
             // If Excel date == 2/29/1900, will become 3/1/1900 in Java representation
             dayAdjust = 0;
         }
-        GregorianCalendar calendar = new GregorianCalendar(startYear,0,
-                                                 wholeDays + dayAdjust);
-        int millisecondsInDay = (int)((date - Math.floor(date)) *
-                                      DAY_MILLISECONDS + 0.5);
+        calendar.set(startYear,0, wholeDays + dayAdjust, 0, 0, 0);
         calendar.set(GregorianCalendar.MILLISECOND, millisecondsInDay);
-        return calendar.getTime();
     }
 
     /**

Modified: poi/branches/ooxml/src/java/org/apache/poi/ss/usermodel/FormulaEvaluator.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/java/org/apache/poi/ss/usermodel/FormulaEvaluator.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/java/org/apache/poi/ss/usermodel/FormulaEvaluator.java (original)
+++ poi/branches/ooxml/src/java/org/apache/poi/ss/usermodel/FormulaEvaluator.java Wed Aug 27 03:34:33 2008
@@ -50,6 +50,7 @@
 import org.apache.poi.hssf.record.formula.eval.Eval;
 import org.apache.poi.hssf.record.formula.eval.FunctionEval;
 import org.apache.poi.hssf.record.formula.eval.NameEval;
+import org.apache.poi.hssf.record.formula.eval.NameXEval;
 import org.apache.poi.hssf.record.formula.eval.NumberEval;
 import org.apache.poi.hssf.record.formula.eval.OperationEval;
 import org.apache.poi.hssf.record.formula.eval.Ref2DEval;
@@ -348,7 +349,8 @@
                 continue; 
             }
             if (ptg instanceof NameXPtg) {
-                // TODO - external functions
+                NameXPtg nameXPtg = (NameXPtg) ptg;
+                stack.push(new NameXEval(nameXPtg.getSheetRefIndex(), nameXPtg.getNameIndex()));
                 continue;
             }
             if (ptg instanceof UnknownPtg) { continue; }

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/eventmodel/TestModelFactory.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/eventmodel/TestModelFactory.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/eventmodel/TestModelFactory.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/eventmodel/TestModelFactory.java Wed Aug 27 03:34:33 2008
@@ -139,7 +139,7 @@
         ByteArrayOutputStream stream = new ByteArrayOutputStream();
         HSSFSheet sheet = book.createSheet("Test");
         HSSFRow   row   = sheet.createRow(0);
-        HSSFCell  cell  = row.createCell((short)0);
+        HSSFCell  cell  = row.createCell(0);
         cell.setCellValue(10.5);
         book.write(stream);
         return stream;

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java Wed Aug 27 03:34:33 2008
@@ -21,6 +21,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
 
 import org.apache.poi.hssf.HSSFTestDataSamples;
@@ -31,6 +32,7 @@
 import org.apache.poi.hssf.record.LabelSSTRecord;
 import org.apache.poi.hssf.record.Record;
 import org.apache.poi.hssf.record.RowRecord;
+import org.apache.poi.hssf.record.SharedFormulaRecord;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 /**
  * Tests for MissingRecordAwareHSSFListener
@@ -39,25 +41,7 @@
 	
 	private Record[] r;
 
-	public void openNormal() {
-		HSSFRequest req = new HSSFRequest();
-		MockHSSFListener mockListen = new MockHSSFListener();
-		MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(mockListen);
-		req.addListenerForAllRecords(listener);
-		
-		HSSFEventFactory factory = new HSSFEventFactory();
-		try {
-			InputStream is = HSSFTestDataSamples.openSampleFileStream("MissingBits.xls");
-			POIFSFileSystem fs = new POIFSFileSystem(is);
-			factory.processWorkbookEvents(req, fs);
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		}
-		
-		r = mockListen.getRecords();
-		assertTrue(r.length > 100);
-	} 
-	public void openAlt() {
+	private void readRecords(String sampleFileName) {
 		HSSFRequest req = new HSSFRequest();
 		MockHSSFListener mockListen = new MockHSSFListener();
 		MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(mockListen);
@@ -65,7 +49,7 @@
 		
 		HSSFEventFactory factory = new HSSFEventFactory();
 		try {
-			InputStream is = HSSFTestDataSamples.openSampleFileStream("MRExtraLines.xls");
+			InputStream is = HSSFTestDataSamples.openSampleFileStream(sampleFileName);
 			POIFSFileSystem fs = new POIFSFileSystem(is);
 			factory.processWorkbookEvents(req, fs);
 		} catch (IOException e) {
@@ -75,8 +59,11 @@
 		r = mockListen.getRecords();
 		assertTrue(r.length > 100);
 	} 
+	public void openNormal() {
+		readRecords("MissingBits.xls");
+	}
 	
-	public void testMissingRowRecords() throws Exception {
+	public void testMissingRowRecords() {
 		openNormal();
 		
 		// We have rows 0, 1, 2, 20 and 21
@@ -126,7 +113,7 @@
 		assertEquals(19, mr.getRowNumber());
 	}
 	
-	public void testEndOfRowRecords() throws Exception {
+	public void testEndOfRowRecords() {
 		openNormal();
 		
 		// Find the cell at 0,0
@@ -248,7 +235,7 @@
 	}
 	
 	
-	public void testMissingCellRecords() throws Exception {
+	public void testMissingCellRecords() {
 		openNormal();
 		
 		// Find the cell at 0,0
@@ -350,29 +337,21 @@
 	
 	// Make sure we don't put in any extra new lines
 	//  that aren't already there
-	public void testNoExtraNewLines() throws Exception {
+	public void testNoExtraNewLines() {
 		// Load a different file
-		openAlt();
-		
-		
 		// This file has has something in lines 1-33
-		List lcor = new ArrayList();
+		readRecords("MRExtraLines.xls");
+		
+		int rowCount=0;
 		for(int i=0; i<r.length; i++) {
-			if(r[i] instanceof LastCellOfRowDummyRecord)
-				lcor.add( (LastCellOfRowDummyRecord)r[i] );
+			if(r[i] instanceof LastCellOfRowDummyRecord) {
+				LastCellOfRowDummyRecord eor = (LastCellOfRowDummyRecord) r[i];
+				assertEquals(rowCount, eor.getRow());
+				rowCount++;
+			}
 		}
-		
 		// Check we got the 33 rows
-		assertEquals(33, lcor.size());
-		LastCellOfRowDummyRecord[] rowEnds = (LastCellOfRowDummyRecord[])
-			lcor.toArray(new LastCellOfRowDummyRecord[lcor.size()]);
-		assertEquals(33, rowEnds.length);
-		
-		// And check they have the right stuff in them,
-		//  no repeats
-		for(int i=0; i<rowEnds.length; i++) {
-			assertEquals(i, rowEnds[i].getRow());
-		}
+		assertEquals(33, rowCount);
 	}
 
 	private static final class MockHSSFListener implements HSSFListener {
@@ -418,4 +397,29 @@
 			return result;
 		}
 	}
+	
+	/**
+	 * Make sure that the presence of shared formulas does not cause extra 
+	 * end-of-row records.
+	 */
+	public void testEndOfRow_bug45672() {
+		readRecords("ex45672.xls");
+		Record[] rr = r;
+		int eorCount=0;
+		int sfrCount=0;
+		for (int i = 0; i < rr.length; i++) {
+			Record record = rr[i];
+			if (record instanceof SharedFormulaRecord) {
+				sfrCount++;
+			}
+			if (record instanceof LastCellOfRowDummyRecord) {
+				eorCount++;
+			}
+		}
+		if (eorCount == 2) {
+			throw new AssertionFailedError("Identified bug 45672");
+		}
+		assertEquals(1, eorCount);
+		assertEquals(1, sfrCount);
+	}
 }

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/TestSSTRecord.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/TestSSTRecord.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/TestSSTRecord.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/TestSSTRecord.java Wed Aug 27 03:34:33 2008
@@ -365,8 +365,8 @@
     {
         HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("duprich1.xls");
         HSSFSheet sheet = wb.getSheetAt( 1 );
-        assertEquals( "01/05 (Wed)", sheet.getRow( 0 ).getCell( (short) 8 ).getStringCellValue() );
-        assertEquals( "01/05 (Wed)", sheet.getRow( 1 ).getCell( (short) 8 ).getStringCellValue() );
+        assertEquals( "01/05 (Wed)", sheet.getRow( 0 ).getCell(8 ).getStringCellValue() );
+        assertEquals( "01/05 (Wed)", sheet.getRow( 1 ).getCell(8 ).getStringCellValue() );
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         wb.write( baos );
@@ -375,12 +375,12 @@
         wb = HSSFTestDataSamples.openSampleWorkbook("duprich2.xls");
         sheet = wb.getSheetAt( 0 );
         int row = 0;
-        assertEquals( "Testing", sheet.getRow( row++ ).getCell( (short) 0 ).getStringCellValue() );
-        assertEquals( "rich", sheet.getRow( row++ ).getCell( (short) 0 ).getStringCellValue() );
-        assertEquals( "text", sheet.getRow( row++ ).getCell( (short) 0 ).getStringCellValue() );
-        assertEquals( "strings", sheet.getRow( row++ ).getCell( (short) 0 ).getStringCellValue() );
-        assertEquals( "Testing", sheet.getRow( row++ ).getCell( (short) 0 ).getStringCellValue() );
-        assertEquals( "Testing", sheet.getRow( row++ ).getCell( (short) 0 ).getStringCellValue() );
+        assertEquals( "Testing", sheet.getRow( row++ ).getCell(0 ).getStringCellValue() );
+        assertEquals( "rich", sheet.getRow( row++ ).getCell(0 ).getStringCellValue() );
+        assertEquals( "text", sheet.getRow( row++ ).getCell(0 ).getStringCellValue() );
+        assertEquals( "strings", sheet.getRow( row++ ).getCell(0 ).getStringCellValue() );
+        assertEquals( "Testing", sheet.getRow( row++ ).getCell(0 ).getStringCellValue() );
+        assertEquals( "Testing", sheet.getRow( row++ ).getCell(0 ).getStringCellValue() );
 
         wb.write( baos );
     }

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java Wed Aug 27 03:34:33 2008
@@ -22,6 +22,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
 
 import org.apache.poi.hssf.model.RecordStream;
@@ -31,6 +32,7 @@
 import org.apache.poi.hssf.record.CFRuleRecord.ComparisonOperator;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.util.LittleEndian;
 
 /**
  * Tests the serialization and deserialization of the CFRecordsAggregate
@@ -63,7 +65,8 @@
 		record = CFRecordsAggregate.createCFAggregate(new RecordStream(recs, 0));
 
 		// Serialize
-		byte [] serializedRecord = record.serialize();
+		byte [] serializedRecord = new byte[record.getRecordSize()];
+		record.serialize(0, serializedRecord);
 		InputStream in = new ByteArrayInputStream(serializedRecord);
 
 		//Parse
@@ -98,4 +101,28 @@
 		assertEquals(2, cellRanges.length);
 		assertEquals(3, header.getNumberOfConditionalFormats());
 	}
+	
+	/**
+	 * Make sure that the CF Header record is properly updated with the number of rules
+	 */
+	public void testNRules() {
+		HSSFWorkbook workbook = new HSSFWorkbook();
+		CellRangeAddress[] cellRanges = {
+				new CellRangeAddress(0,1,0,0),
+				new CellRangeAddress(0,1,2,2),
+		};
+		CFRuleRecord[] rules = {
+			CFRuleRecord.create(workbook, "7"),
+			CFRuleRecord.create(workbook, ComparisonOperator.BETWEEN, "2", "5"),
+		};
+		CFRecordsAggregate agg = new CFRecordsAggregate(cellRanges, rules);
+		byte[] serializedRecord = new byte[agg.getRecordSize()];
+		agg.serialize(0, serializedRecord);
+		
+		int nRules = LittleEndian.getUShort(serializedRecord, 4);
+		if (nRules == 0) {
+			throw new AssertionFailedError("Identified bug 45682 b");
+		}
+		assertEquals(rules.length, nRules);
+	}
 }

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/aggregates/TestValueRecordsAggregate.java Wed Aug 27 03:34:33 2008
@@ -257,7 +257,7 @@
         }
     }
     private static String getFormulaFromFirstCell(HSSFSheet s, int rowIx) {
-        return s.getRow(rowIx).getCell((short)0).getCellFormula();
+        return s.getRow(rowIx).getCell(0).getCellFormula();
     }
 
     /**

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestAreaErrPtg.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestAreaErrPtg.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestAreaErrPtg.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestAreaErrPtg.java Wed Aug 27 03:34:33 2008
@@ -34,7 +34,7 @@
     {
         HSSFWorkbook workbook = loadWorkbook("AreaErrPtg.xls");
         assertEquals("Wrong formula string for area error", "SUM(#REF!)",
-                     workbook.getSheetAt(0).getRow(0).getCell((short) 2).getCellFormula());
+                     workbook.getSheetAt(0).getRow(0).getCell(2).getCellFormula());
     }
 }
 

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestArrayPtg.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestArrayPtg.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestArrayPtg.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestArrayPtg.java Wed Aug 27 03:34:33 2008
@@ -103,7 +103,7 @@
 		HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("ex42564-elementOrder.xls");
 
 		// The formula has an array with 3 rows and 5 columns 
-		String formula = wb.getSheetAt(0).getRow(0).getCell((short)0).getCellFormula();
+		String formula = wb.getSheetAt(0).getRow(0).getCell(0).getCellFormula();
 		// TODO - These number literals should not have '.0'. Excel has different number rendering rules
 
 		if (formula.equals("SUM({1.0,6.0,11.0;2.0,7.0,12.0;3.0,8.0,13.0;4.0,9.0,14.0;5.0,10.0,15.0})")) {

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestErrPtg.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestErrPtg.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestErrPtg.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestErrPtg.java Wed Aug 27 03:34:33 2008
@@ -34,7 +34,7 @@
     public void testReading() throws Exception
     {
         HSSFWorkbook workbook = loadWorkbook("ErrPtg.xls");
-        HSSFCell cell = workbook.getSheetAt(0).getRow(3).getCell((short) 0);
+        HSSFCell cell = workbook.getSheetAt(0).getRow(3).getCell(0);
         assertEquals("Wrong cell value", 4.0, cell.getNumericCellValue(), 0.0);
         assertEquals("Wrong cell formula", "ERROR.TYPE(#REF!)", cell.getCellFormula());
     }

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestExternalFunctionFormulas.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestExternalFunctionFormulas.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestExternalFunctionFormulas.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestExternalFunctionFormulas.java Wed Aug 27 03:34:33 2008
@@ -71,7 +71,7 @@
 		}
 	}
 	
-	public void DISABLEDtestEvaluate() {
+	public void testEvaluate() {
 		HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("externalFunctionExample.xls");
 		HSSFSheet sheet = wb.getSheetAt(0);
 		HSSFCell cell = sheet.getRow(0).getCell(0);

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestIntersectionPtg.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestIntersectionPtg.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestIntersectionPtg.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestIntersectionPtg.java Wed Aug 27 03:34:33 2008
@@ -34,7 +34,7 @@
     public void testReading() throws Exception
     {
         HSSFWorkbook workbook = loadWorkbook("IntersectionPtg.xls");
-        HSSFCell cell = workbook.getSheetAt(0).getRow(4).getCell((short) 2);
+        HSSFCell cell = workbook.getSheetAt(0).getRow(4).getCell(2);
         assertEquals("Wrong cell value", 5.0, cell.getNumericCellValue(), 0.0);
         assertEquals("Wrong cell formula", "SUM(A1:B2 B2:C3)", cell.getCellFormula());
     }

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestPercentPtg.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestPercentPtg.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestPercentPtg.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestPercentPtg.java Wed Aug 27 03:34:33 2008
@@ -37,11 +37,11 @@
         HSSFSheet sheet = workbook.getSheetAt(0);
 
         assertEquals("Wrong numeric value for original number", 53000.0,
-                     sheet.getRow(0).getCell((short) 0).getNumericCellValue(), 0.0);
+                     sheet.getRow(0).getCell(0).getNumericCellValue(), 0.0);
         assertEquals("Wrong numeric value for percent formula result", 5300.0,
-                     sheet.getRow(1).getCell((short) 0).getNumericCellValue(), 0.0);
+                     sheet.getRow(1).getCell(0).getNumericCellValue(), 0.0);
         assertEquals("Wrong formula string for percent formula", "A1*10%",
-                     sheet.getRow(1).getCell((short) 0).getCellFormula());
+                     sheet.getRow(1).getCell(0).getCellFormula());
     }
 }
 

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestRangePtg.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestRangePtg.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestRangePtg.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestRangePtg.java Wed Aug 27 03:34:33 2008
@@ -34,7 +34,7 @@
     public void testReading() throws Exception
     {
         HSSFWorkbook workbook = loadWorkbook("RangePtg.xls");
-        HSSFCell cell = workbook.getSheetAt(0).getRow(3).getCell((short) 1);
+        HSSFCell cell = workbook.getSheetAt(0).getRow(3).getCell(1);
         assertEquals("Wrong cell value", 10.0, cell.getNumericCellValue(), 0.0);
         assertEquals("Wrong cell formula", "SUM(pineapple:B2)", cell.getCellFormula());
     }

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestReferencePtg.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestReferencePtg.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestReferencePtg.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestReferencePtg.java Wed Aug 27 03:34:33 2008
@@ -41,41 +41,41 @@
 
         // First row
         assertEquals("Wrong numeric value for original number", 55.0,
-                     sheet.getRow(0).getCell((short) 0).getNumericCellValue(), 0.0);
+                     sheet.getRow(0).getCell(0).getNumericCellValue(), 0.0);
         assertEquals("Wrong numeric value for referemce", 55.0,
-                     sheet.getRow(0).getCell((short) 1).getNumericCellValue(), 0.0);
+                     sheet.getRow(0).getCell(1).getNumericCellValue(), 0.0);
         assertEquals("Wrong formula string for reference", "A1",
-                     sheet.getRow(0).getCell((short) 1).getCellFormula());
+                     sheet.getRow(0).getCell(1).getCellFormula());
         
         // Now moving over the 2**15 boundary
         // (Remember that excel row (n) is poi row (n-1)
         assertEquals("Wrong numeric value for original number", 32767.0,
-                sheet.getRow(32766).getCell((short) 0).getNumericCellValue(), 0.0);
+                sheet.getRow(32766).getCell(0).getNumericCellValue(), 0.0);
         assertEquals("Wrong numeric value for referemce", 32767.0,
-                sheet.getRow(32766).getCell((short) 1).getNumericCellValue(), 0.0);
+                sheet.getRow(32766).getCell(1).getNumericCellValue(), 0.0);
         assertEquals("Wrong formula string for reference", "A32767",
-                sheet.getRow(32766).getCell((short) 1).getCellFormula());
+                sheet.getRow(32766).getCell(1).getCellFormula());
         
         assertEquals("Wrong numeric value for original number", 32768.0,
-                sheet.getRow(32767).getCell((short) 0).getNumericCellValue(), 0.0);
+                sheet.getRow(32767).getCell(0).getNumericCellValue(), 0.0);
         assertEquals("Wrong numeric value for referemce", 32768.0,
-                sheet.getRow(32767).getCell((short) 1).getNumericCellValue(), 0.0);
+                sheet.getRow(32767).getCell(1).getNumericCellValue(), 0.0);
         assertEquals("Wrong formula string for reference", "A32768",
-                sheet.getRow(32767).getCell((short) 1).getCellFormula());
+                sheet.getRow(32767).getCell(1).getCellFormula());
         
         assertEquals("Wrong numeric value for original number", 32769.0,
-                sheet.getRow(32768).getCell((short) 0).getNumericCellValue(), 0.0);
+                sheet.getRow(32768).getCell(0).getNumericCellValue(), 0.0);
         assertEquals("Wrong numeric value for referemce", 32769.0,
-                sheet.getRow(32768).getCell((short) 1).getNumericCellValue(), 0.0);
+                sheet.getRow(32768).getCell(1).getNumericCellValue(), 0.0);
         assertEquals("Wrong formula string for reference", "A32769",
-                sheet.getRow(32768).getCell((short) 1).getCellFormula());
+                sheet.getRow(32768).getCell(1).getCellFormula());
         
         assertEquals("Wrong numeric value for original number", 32770.0,
-                sheet.getRow(32769).getCell((short) 0).getNumericCellValue(), 0.0);
+                sheet.getRow(32769).getCell(0).getNumericCellValue(), 0.0);
         assertEquals("Wrong numeric value for referemce", 32770.0,
-                sheet.getRow(32769).getCell((short) 1).getNumericCellValue(), 0.0);
+                sheet.getRow(32769).getCell(1).getNumericCellValue(), 0.0);
         assertEquals("Wrong formula string for reference", "A32770",
-                sheet.getRow(32769).getCell((short) 1).getCellFormula());
+                sheet.getRow(32769).getCell(1).getCellFormula());
     }
     
     public void testBug44921() {

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestUnionPtg.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestUnionPtg.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestUnionPtg.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/TestUnionPtg.java Wed Aug 27 03:34:33 2008
@@ -34,7 +34,7 @@
     public void testReading() throws Exception
     {
         HSSFWorkbook workbook = loadWorkbook("UnionPtg.xls");
-        HSSFCell cell = workbook.getSheetAt(0).getRow(4).getCell((short) 2);
+        HSSFCell cell = workbook.getSheetAt(0).getRow(4).getCell(2);
         assertEquals("Wrong cell value", 24.0, cell.getNumericCellValue(), 0.0);
         assertEquals("Wrong cell formula", "SUM(A1:B2,B2:C3)", cell.getCellFormula());
     }

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/function/TestReadMissingBuiltInFuncs.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/function/TestReadMissingBuiltInFuncs.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/function/TestReadMissingBuiltInFuncs.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/record/formula/function/TestReadMissingBuiltInFuncs.java Wed Aug 27 03:34:33 2008
@@ -150,7 +150,7 @@
 			// some other unexpected error
 			throw e;
 		}
-		String result = sheet.getRow(rowIx).getCell((short)0).getCellFormula();
+		String result = sheet.getRow(rowIx).getCell(0).getCellFormula();
 		if (false) {
 			System.err.println(result);
 		}

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java Wed Aug 27 03:34:33 2008
@@ -85,7 +85,7 @@
                 c.setCellValue(rownum * 10000 + cellnum
                                + ((( double ) rownum / 1000)
                                   + (( double ) cellnum / 10000)));
-                c = r.createCell(( short ) (cellnum + 1));
+                c = r.createCell(cellnum + 1);
                 c.setCellValue("TEST");
                 c.setCellStyle(cs);
             }
@@ -112,16 +112,16 @@
         HSSFWorkbook     wb   = new HSSFWorkbook();
         HSSFSheet        s    = wb.createSheet();
         HSSFCellStyle    cs   = wb.createCellStyle();
-        HSSFRow row = s.createRow((short)0);
+        HSSFRow row = s.createRow(0);
 
         // with Date:
-        HSSFCell cell = row.createCell((short)1);
+        HSSFCell cell = row.createCell(1);
         cs.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy"));
         cell.setCellStyle(cs);
         cell.setCellValue(new Date());
 
         // with Calendar:
-        cell = row.createCell((short)2);
+        cell = row.createCell(2);
         cs.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy"));
         cell.setCellStyle(cs);
         Calendar cal = Calendar.getInstance();
@@ -143,9 +143,9 @@
         HSSFSheet        s    = wb.createSheet();
         HSSFCellStyle    cs1  = wb.createCellStyle();
         HSSFCellStyle    cs2  = wb.createCellStyle();
-        HSSFRow row = s.createRow((short)0);
-        HSSFCell cell1 = row.createCell((short)1);
-        HSSFCell cell2 = row.createCell((short)2);
+        HSSFRow row = s.createRow(0);
+        HSSFCell cell1 = row.createCell(1);
+        HSSFCell cell2 = row.createCell(2);
         
         cs1.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy"));
         cs2.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/dd/yy"));
@@ -215,7 +215,7 @@
                                + ((( double ) rownum / 1000)
                                   + (( double ) cellnum / 10000)));
                 c.setCellStyle(cs);
-                c = r.createCell(( short ) (cellnum + 1));
+                c = r.createCell(cellnum + 1);
                 c.setCellValue("TEST");
                 c.setCellStyle(cs2);
             }

Modified: poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java
URL: http://svn.apache.org/viewvc/poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java?rev=689435&r1=689434&r2=689435&view=diff
==============================================================================
--- poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java (original)
+++ poi/branches/ooxml/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java Wed Aug 27 03:34:33 2008
@@ -111,7 +111,7 @@
 					inputBox, errorBox);
 			if (_cellStyle != null) {
 				HSSFRow row = _sheet.getRow(_sheet.getPhysicalNumberOfRows() - 1);
-				HSSFCell cell = row.createCell((short) 0);
+				HSSFCell cell = row.createCell(0);
 				cell.setCellStyle(_cellStyle);
 			}
 			writeOtherSettings(_sheet, _style_1, promptDescr);
@@ -144,26 +144,26 @@
 				boolean errorBox) {
 			HSSFRow row = sheet.createRow(sheet.getPhysicalNumberOfRows());
 			// condition's string
-			HSSFCell cell = row.createCell((short) 1);
+			HSSFCell cell = row.createCell(1);
 			cell.setCellStyle(style_1);
 			setCellValue(cell, strCondition);
 			// allow empty cells
-			cell = row.createCell((short) 2);
+			cell = row.createCell(2);
 			cell.setCellStyle(style_2);
 			setCellValue(cell, ((allowEmpty) ? "yes" : "no"));
 			// show input box
-			cell = row.createCell((short) 3);
+			cell = row.createCell(3);
 			cell.setCellStyle(style_2);
 			setCellValue(cell, ((inputBox) ? "yes" : "no"));
 			// show error box
-			cell = row.createCell((short) 4);
+			cell = row.createCell(4);
 			cell.setCellStyle(style_2);
 			setCellValue(cell, ((errorBox) ? "yes" : "no"));
 		}
 		private static void writeOtherSettings(HSSFSheet sheet, HSSFCellStyle style,
 				String strStettings) {
 			HSSFRow row = sheet.getRow(sheet.getPhysicalNumberOfRows() - 1);
-			HSSFCell cell = row.createCell((short) 5);
+			HSSFCell cell = row.createCell(5);
 			cell.setCellStyle(style);
 			setCellValue(cell, strStettings);
 		}
@@ -256,7 +256,7 @@
 			HSSFRow row = sheet.createRow(sheet.getPhysicalNumberOfRows());
 			row = sheet.createRow(sheet.getPhysicalNumberOfRows());
 			sheet.addMergedRegion(new CellRangeAddress(sheet.getPhysicalNumberOfRows()-1, sheet.getPhysicalNumberOfRows()-1, 0, 5));
-			HSSFCell cell = row.createCell((short) 0);
+			HSSFCell cell = row.createCell(0);
 			setCellValue(cell, strTypeDescription);
 			cell.setCellStyle(_style_3);
 			row = sheet.createRow(sheet.getPhysicalNumberOfRows());
@@ -267,7 +267,7 @@
 			HSSFRow row = sheet.createRow(sheet.getPhysicalNumberOfRows());
 			row.setHeight((short) 400);
 			for (int i = 0; i < 6; i++) {
-				row.createCell((short) i).setCellStyle(_style_4);
+				row.createCell(i).setCellStyle(_style_4);
 				if (i == 2 || i == 3 || i == 4) {
 					sheet.setColumnWidth((short) i, (short) 3500);
 				} else if (i == 5) {
@@ -276,17 +276,17 @@
 					sheet.setColumnWidth((short) i, (short) 8000);
 				}
 			}
-			HSSFCell cell = row.getCell((short) 0);
+			HSSFCell cell = row.getCell(0);
 			setCellValue(cell, "Data validation cells");
-			cell = row.getCell((short) 1);
+			cell = row.getCell(1);
 			setCellValue(cell, "Condition");
-			cell = row.getCell((short) 2);
+			cell = row.getCell(2);
 			setCellValue(cell, "Allow blank");
-			cell = row.getCell((short) 3);
+			cell = row.getCell(3);
 			setCellValue(cell, "Prompt box");
-			cell = row.getCell((short) 4);
+			cell = row.getCell(4);
 			setCellValue(cell, "Error box");
-			cell = row.getCell((short) 5);
+			cell = row.getCell(5);
 			setCellValue(cell, "Other settings");
 		}
 
@@ -298,7 +298,7 @@
 			HSSFSheet sheet = _currentSheet;
 			HSSFRow row = sheet.getRow(sheet.getPhysicalNumberOfRows()-1);
 			sheet.addMergedRegion(new CellRangeAddress(sheet.getPhysicalNumberOfRows()-1, sheet.getPhysicalNumberOfRows()-1, 0, 5));
-			HSSFCell cell = row.createCell((short)0);
+			HSSFCell cell = row.createCell(0);
 			setCellValue(cell, strTypeDescription);
 			cell.setCellStyle(_style_3);
 			row = sheet.createRow(sheet.getPhysicalNumberOfRows());
@@ -395,14 +395,14 @@
 		// add list data on same sheet
 		for (int i = 0; i < 10; i++) {
 			HSSFRow currRow = fSheet.createRow(i + 29);
-			setCellValue(currRow.createCell((short) 0), cellStrValue);
+			setCellValue(currRow.createCell(0), cellStrValue);
 		}
 		// add list data on another sheet
 		for (int i = 0; i < 10; i++) {
 			HSSFRow currRow = dataSheet.createRow(i + 0);
-			setCellValue(currRow.createCell((short) 0), "Data a" + i);
-			setCellValue(currRow.createCell((short) 1), "Data b" + i);
-			setCellValue(currRow.createCell((short) 2), "Data c" + i);
+			setCellValue(currRow.createCell(0), "Data a" + i);
+			setCellValue(currRow.createCell(1), "Data b" + i);
+			setCellValue(currRow.createCell(2), "Data c" + i);
 		}
 	}
 



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


Mime
View raw message