aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJosh Micich <josh@apache.org>2008-04-03 21:17:26 +0000
committerJosh Micich <josh@apache.org>2008-04-03 21:17:26 +0000
commitb938b6c97f47f085757b330d1bce90293c863afb (patch)
treed5f3fc22886409682ef05a154b24bbed762737b4 /src
parentfd84995b3f1d19fce6cb5254100ab147ef532954 (diff)
downloadpoi-b938b6c97f47f085757b330d1bce90293c863afb.tar.gz
poi-b938b6c97f47f085757b330d1bce90293c863afb.zip
Follow up fix after r644473 (bug 44739) TestHSSFConditionalFormatting had a bug and wasn't yet included in the test suite hierarchy
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@644509 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/poi/hssf/record/cf/CellRange.java6
-rwxr-xr-xsrc/testcases/org/apache/poi/hssf/usermodel/AllUserModelTests.java1
-rw-r--r--src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConditionalFormatting.java (renamed from src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConfditionalFormatting.java)6
3 files changed, 7 insertions, 6 deletions
diff --git a/src/java/org/apache/poi/hssf/record/cf/CellRange.java b/src/java/org/apache/poi/hssf/record/cf/CellRange.java
index f8839d99c1..f45b79b003 100644
--- a/src/java/org/apache/poi/hssf/record/cf/CellRange.java
+++ b/src/java/org/apache/poi/hssf/record/cf/CellRange.java
@@ -78,8 +78,8 @@ public final class CellRange
return _firstColumn == 0 && _lastColumn == LAST_COLUMN_INDEX;
}
- public CellRange(Region r) {
- this(r.getRowFrom(), r.getRowTo(), r.getColumnFrom(), r.getColumnTo());
+ private static CellRange createFromRegion(Region r) {
+ return new CellRange(r.getRowFrom(), r.getRowTo(), r.getColumnFrom(), r.getColumnTo());
}
private static boolean isValid(int firstRow, int lastRow, int firstColumn, int lastColumn)
@@ -358,7 +358,7 @@ public final class CellRange
CellRange[] result = new CellRange[regions.length];
for( int i=0; i<regions.length; i++)
{
- result[i] = new CellRange(regions[i]);
+ result[i] = createFromRegion(regions[i]);
}
return result;
}
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/AllUserModelTests.java b/src/testcases/org/apache/poi/hssf/usermodel/AllUserModelTests.java
index cbc555da36..6d6b053a63 100755
--- a/src/testcases/org/apache/poi/hssf/usermodel/AllUserModelTests.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/AllUserModelTests.java
@@ -40,6 +40,7 @@ public class AllUserModelTests {
result.addTestSuite(TestFormulas.class);
result.addTestSuite(TestHSSFCell.class);
result.addTestSuite(TestHSSFClientAnchor.class);
+ result.addTestSuite(TestHSSFConditionalFormatting.class);
result.addTestSuite(TestHSSFComment.class);
result.addTestSuite(TestHSSFDateUtil.class);
result.addTestSuite(TestHSSFHeaderFooter.class);
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConfditionalFormatting.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConditionalFormatting.java
index 6186d227ef..5dcc61aa41 100644
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConfditionalFormatting.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFConditionalFormatting.java
@@ -26,7 +26,7 @@ import org.apache.poi.hssf.util.Region;
*
* @author Dmitriy Kumshayev
*/
-public final class TestHSSFConfditionalFormatting extends TestCase
+public final class TestHSSFConditionalFormatting extends TestCase
{
public void testLastAndFirstColumns()
{
@@ -55,7 +55,7 @@ public final class TestHSSFConfditionalFormatting extends TestCase
short col = 1;
Region [] regions =
{
- new Region(0,col,-1,col)
+ new Region(0,col,65535,col)
};
sheet.addConditionalFormatting(regions, cfRules);
@@ -75,7 +75,7 @@ public final class TestHSSFConfditionalFormatting extends TestCase
assertEquals(1, r.getColumnFrom());
assertEquals(1, r.getColumnTo());
assertEquals(0, r.getRowFrom());
- assertEquals(-1, r.getRowTo());
+ assertEquals(65535, r.getRowTo());
assertEquals(2, cf.getNumberOfRules());