Return-Path: Delivered-To: apmail-poi-commits-archive@locus.apache.org Received: (qmail 57839 invoked from network); 31 Mar 2008 05:11:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Mar 2008 05:11:35 -0000 Received: (qmail 92137 invoked by uid 500); 31 Mar 2008 05:11:35 -0000 Delivered-To: apmail-poi-commits-archive@poi.apache.org Received: (qmail 92074 invoked by uid 500); 31 Mar 2008 05:11:35 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 92065 invoked by uid 99); 31 Mar 2008 05:11:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Mar 2008 22:11:34 -0700 X-ASF-Spam-Status: No, hits=-1998.9 required=10.0 tests=ALL_TRUSTED,FB_GET_MEDS X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Mar 2008 05:10:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8B01A1A9832; Sun, 30 Mar 2008 22:11:05 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r642878 [1/2] - in /poi/trunk/src: documentation/content/xdocs/ java/org/apache/poi/hssf/record/ java/org/apache/poi/hssf/record/aggregates/ java/org/apache/poi/hssf/record/cf/ java/org/apache/poi/hssf/usermodel/ testcases/org/apache/poi/hs... Date: Mon, 31 Mar 2008 05:10:55 -0000 To: commits@poi.apache.org From: josh@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080331051105.8B01A1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: josh Date: Sun Mar 30 22:10:35 2008 New Revision: 642878 URL: http://svn.apache.org/viewvc?rev=642878&view=rev Log: More work on Conditional Formatting (bug 30311) junit and fixes from Dmitriy. Some other clean-up. Added: poi/trunk/src/testcases/org/apache/poi/hssf/record/aggregates/AllRecordAggregateTests.java poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConfditionalFormatting.java Modified: poi/trunk/src/documentation/content/xdocs/changes.xml poi/trunk/src/documentation/content/xdocs/status.xml poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java poi/trunk/src/java/org/apache/poi/hssf/record/CFRuleRecord.java poi/trunk/src/java/org/apache/poi/hssf/record/aggregates/CFRecordsAggregate.java poi/trunk/src/java/org/apache/poi/hssf/record/cf/CellRange.java poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFBorderFormatting.java poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.java poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormattingRule.java poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java poi/trunk/src/testcases/org/apache/poi/hssf/record/AllRecordTests.java poi/trunk/src/testcases/org/apache/poi/hssf/record/TestCFHeaderRecord.java poi/trunk/src/testcases/org/apache/poi/hssf/record/TestCFRuleRecord.java poi/trunk/src/testcases/org/apache/poi/hssf/record/aggregates/TestCFRecordsAggregate.java poi/trunk/src/testcases/org/apache/poi/hssf/record/cf/TestCellRange.java Modified: poi/trunk/src/documentation/content/xdocs/changes.xml URL: http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/changes.xml?rev=642878&r1=642877&r2=642878&view=diff ============================================================================== --- poi/trunk/src/documentation/content/xdocs/changes.xml (original) +++ poi/trunk/src/documentation/content/xdocs/changes.xml Sun Mar 30 22:10:35 2008 @@ -26,6 +26,7 @@ + @@ -36,6 +37,7 @@ + 30311 - More work on Conditional Formatting Move the Formula Evaluator code out of scratchpad Move the missing record aware eventusermodel code out of scratchpad 44652 / 44603 - Improved handling of Pictures in Word Documents Modified: poi/trunk/src/documentation/content/xdocs/status.xml URL: http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/status.xml?rev=642878&r1=642877&r2=642878&view=diff ============================================================================== --- poi/trunk/src/documentation/content/xdocs/status.xml (original) +++ poi/trunk/src/documentation/content/xdocs/status.xml Sun Mar 30 22:10:35 2008 @@ -22,6 +22,7 @@ + @@ -33,6 +34,7 @@ + 30311 - More work on Conditional Formatting Move the Formula Evaluator code out of scratchpad Move the missing record aware eventusermodel code out of scratchpad 44652 / 44603 - Improved handling of Pictures in Word Documents Modified: poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java?rev=642878&r1=642877&r2=642878&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java (original) +++ poi/trunk/src/java/org/apache/poi/hssf/record/CFHeaderRecord.java Sun Mar 30 22:10:35 2008 @@ -15,18 +15,10 @@ limitations under the License. ==================================================================== */ -/* - * ConditionalFormattingHeaderRecord.java - * - * Created on January 17, 2008, 3:05 AM - */ package org.apache.poi.hssf.record; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - import org.apache.poi.hssf.record.cf.CellRange; +import org.apache.poi.hssf.util.Region; import org.apache.poi.util.LittleEndian; /** @@ -34,19 +26,27 @@ * * @author Dmitriy Kumshayev */ -public class CFHeaderRecord extends Record +public final class CFHeaderRecord extends Record { public static final short sid = 0x1B0; + private static final CellRange[] EMPTY_CELL_RANGE_ARRAY = { }; + private int field_1_numcf; private int field_2_need_recalculation; private CellRange field_3_enclosing_cell_range; - private List field_4_cell_ranges; + private CellRange[] field_4_cell_ranges; /** Creates new CFHeaderRecord */ public CFHeaderRecord() { - field_4_cell_ranges = new ArrayList(5); + field_4_cell_ranges = EMPTY_CELL_RANGE_ARRAY; + } + public CFHeaderRecord(Region[] regions) + { + CellRange[] unmergedRanges = CellRange.convertRegionsToCellRanges(regions); + CellRange[] mergeCellRanges = CellRange.mergeCellRanges(unmergedRanges); + setCellRanges(mergeCellRanges); } public CFHeaderRecord(RecordInputStream in) @@ -60,11 +60,12 @@ field_2_need_recalculation = in.readShort(); field_3_enclosing_cell_range = new CellRange(in.readShort(),in.readShort(),in.readShort(),in.readShort()); int numCellRanges = in.readShort(); - field_4_cell_ranges = new ArrayList(5); + CellRange[] crs = new CellRange[numCellRanges]; for( int i=0; i0) + buffer.append(" .id = ").append(Integer.toHexString(sid)).append("\n"); + buffer.append(" .numCF = ").append(getNumberOfConditionalFormats()).append("\n"); + buffer.append(" .needRecalc = ").append(getNeedRecalculation()).append("\n"); + buffer.append(" .enclosingCellRange= ").append(getEnclosingCellRange()).append("\n"); + if( field_4_cell_ranges.length>0) { - buffer.append(" .cfranges=["); - for( int i=0; i