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
This commit is contained in:
Josh Micich 2008-04-03 21:17:26 +00:00
parent fd84995b3f
commit b938b6c97f
3 changed files with 7 additions and 6 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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());