revert accidental commits in r1777435

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1777436 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2017-01-05 08:36:06 +00:00
parent c97db66e07
commit 30a548a514
2 changed files with 13 additions and 57 deletions

View File

@ -256,8 +256,7 @@ public class ColumnHelper {
if(fromCol.isSetCollapsed()) toCol.setCollapsed(fromCol.getCollapsed());
if(fromCol.isSetPhonetic()) toCol.setPhonetic(fromCol.getPhonetic());
if(fromCol.isSetOutlineLevel()) toCol.setOutlineLevel(fromCol.getOutlineLevel());
// this is probably wrong.
//toCol.setCollapsed(fromCol.isSetCollapsed());
toCol.setCollapsed(fromCol.isSetCollapsed());
}
public void setColBestFit(long index, boolean bestFit) {

View File

@ -442,17 +442,6 @@ public final class TestXSSFSheet extends BaseTestXSheet {
* completely clear in all cases what it's supposed to
* be doing... Someone who understands the goals a little
* better should really review this!
*
* Graphically, this is what we're creating:
*
* Column
*
* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
*
* After groupColumn(4,7)
* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
* +--------+ +-----------+
*
*/
@Test
public void setColumnGroupCollapsed() throws IOException {
@ -462,29 +451,17 @@ public final class TestXSSFSheet extends BaseTestXSheet {
CTCols cols = sheet1.getCTWorksheet().getColsArray(0);
assertEquals(0, cols.sizeOfColArray());
// Column
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
// ++++++++++
//
sheet1.groupColumn( 4, 7 );
assertEquals(1, cols.sizeOfColArray());
checkColumnGroup(cols.getColArray(0), 4, 7); // false, true
// Column
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
// ++++++++++ +++++++++++++
//
sheet1.groupColumn( 9, 12 );
assertEquals(2, cols.sizeOfColArray());
checkColumnGroup(cols.getColArray(0), 4, 7); // false, true
checkColumnGroup(cols.getColArray(1), 9, 12); // false, true
// Column
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
// ++++++++++ +++++++++++++
// ++++++
sheet1.groupColumn( 10, 11 );
assertEquals(4, cols.sizeOfColArray());
@ -494,10 +471,6 @@ public final class TestXSSFSheet extends BaseTestXSheet {
checkColumnGroup(cols.getColArray(3), 12, 12); // false, true
// collapse columns - 1
// Column
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
// ---------- +++++++++++++
// ++++++
sheet1.setColumnGroupCollapsed( 5, true );
// FIXME: we grew a column?
@ -510,10 +483,6 @@ public final class TestXSSFSheet extends BaseTestXSheet {
// expand columns - 1
// Column
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
// ++++++++++ +++++++++++++
// ++++++
sheet1.setColumnGroupCollapsed( 5, false );
assertEquals(5, cols.sizeOfColArray());
@ -525,13 +494,8 @@ public final class TestXSSFSheet extends BaseTestXSheet {
//collapse - 2
// Column
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
// ++++++++++ -------------
// -----
// can lower-level outlines be expanded if their parents are collapsed?
sheet1.setColumnGroupCollapsed( 9, true );
// FIXME: it grew again?
// it grew again?
assertEquals(6, cols.sizeOfColArray());
checkColumnGroup(cols.getColArray(0), 4, 7); // false, true
checkColumnGroup(cols.getColArray(1), 8, 8, false, false);
@ -543,19 +507,11 @@ public final class TestXSSFSheet extends BaseTestXSheet {
//expand - 2
// Column
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
// ++++++++++ +++++++++++++
// ++++++
// do collapsed lower-level outlines get expanded if their parents are expanded?
// how much of this is Excel GUI behavior convenience and what is allowed
// per the OOXML format?
sheet1.setColumnGroupCollapsed( 9, false );
assertEquals(6, cols.sizeOfColArray());
//outline level 2: the line under ==> collapsed==True
assertEquals(2, cols.getColArray(3).getOutlineLevel());
assertTrue(cols.getColArray(3).getCollapsed());
assertTrue(cols.getColArray(4).isSetCollapsed());
checkColumnGroup(cols.getColArray(0), 4, 7);
@ -590,7 +546,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
wb1.close();
sheet1 = wb2.getSheetAt(0);
// FIXME: forgot to reassign!
cols = sheet1.getCTWorksheet().getColsArray(0);
//cols = sheet1.getCTWorksheet().getColsArray(0);
assertEquals(6, cols.sizeOfColArray());
checkColumnGroup(cols.getColArray(0), 4, 7); // false, true
@ -634,9 +590,8 @@ public final class TestXSSFSheet extends BaseTestXSheet {
) {
assertEquals("from column index", fromColumnIndex, col.getMin() - 1); // 1 based
assertEquals("to column index", toColumnIndex, col.getMax() - 1); // 1 based
//assertFalse("isSetHidden", col.isSetHidden());
// group collapse state is either unset or not collapsed
assertFalse("collapsed", col.isSetCollapsed() && col.getCollapsed());
assertFalse("isSetHidden", col.isSetHidden());
assertTrue("isSetCollapsed", col.isSetCollapsed()); //not necessarily set
}
/**
* Verify that column groups were created correctly after Sheet.groupColumn
@ -651,8 +606,9 @@ public final class TestXSSFSheet extends BaseTestXSheet {
) {
assertEquals("from column index", fromColumnIndex, col.getMin() - 1); // 1 based
assertEquals("to column index", toColumnIndex, col.getMax() - 1); // 1 based
// assertTrue("isSetHidden", col.isSetHidden());
assertTrue("collapsed", col.isSetCollapsed() && col.getCollapsed());
assertTrue("isSetHidden", col.isSetHidden());
assertTrue("isSetCollapsed", col.isSetCollapsed());
//assertTrue("getCollapsed", col.getCollapsed());
}
/**
* Verify that column groups were created correctly after Sheet.groupColumn
@ -667,9 +623,10 @@ public final class TestXSSFSheet extends BaseTestXSheet {
) {
assertEquals("from column index", fromColumnIndex, col.getMin() - 1); // 1 based
assertEquals("to column index", toColumnIndex, col.getMax() - 1); // 1 based
// assertFalse("isSetHidden", col.isSetHidden());
// group collapse state is either unset or not collapsed
assertFalse("collapsed", col.isSetCollapsed() && col.getCollapsed());
assertFalse("isSetHidden", col.isSetHidden());
assertTrue("isSetCollapsed", col.isSetCollapsed());
//assertTrue("isSetCollapsed", !col.isSetCollapsed() || !col.getCollapsed());
//assertFalse("getCollapsed", col.getCollapsed());
}
/**