From ca020a8be255ead1cc939e16e3174129e7fb18fa Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 24 Apr 2015 02:20:57 +0000 Subject: [PATCH] Fix some inconsistent whitespace git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1675748 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xssf/usermodel/TestXSSFBugs.java | 1724 +++++++++-------- 1 file changed, 870 insertions(+), 854 deletions(-) diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java index 6a09b9033d..71e008485f 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -31,8 +31,6 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; import java.util.Arrays; import java.util.Calendar; import java.util.List; @@ -57,7 +55,26 @@ import org.apache.poi.ss.formula.eval.ErrorEval; import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.ValueEval; import org.apache.poi.ss.formula.functions.Function; -import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.usermodel.BaseTestBugzillaIssues; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.CellValue; +import org.apache.poi.ss.usermodel.ClientAnchor; +import org.apache.poi.ss.usermodel.Comment; +import org.apache.poi.ss.usermodel.CreationHelper; +import org.apache.poi.ss.usermodel.DataFormatter; +import org.apache.poi.ss.usermodel.DateUtil; +import org.apache.poi.ss.usermodel.Drawing; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.FormulaError; +import org.apache.poi.ss.usermodel.FormulaEvaluator; +import org.apache.poi.ss.usermodel.Hyperlink; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.Name; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; import org.apache.poi.ss.util.AreaReference; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellReference; @@ -77,7 +94,6 @@ import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet; import org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTFontImpl; public final class TestXSSFBugs extends BaseTestBugzillaIssues { - public TestXSSFBugs() { super(XSSFITestDataProvider.instance); } @@ -191,7 +207,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { assertEquals(1, rels.size()); assertEquals("Sheet1!A1", rels.get(0).getPackageRelationship().getTargetURI().getFragment()); } - + /** * Excel will sometimes write a button with a textbox * containing >br< (not closed!). @@ -200,7 +216,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { */ @Test public void bug49020() throws Exception { - /*XSSFWorkbook wb =*/ XSSFTestDataSamples.openSampleWorkbook("BrNotClosed.xlsx"); + /*XSSFWorkbook wb =*/ XSSFTestDataSamples.openSampleWorkbook("BrNotClosed.xlsx"); } /** @@ -212,42 +228,42 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { CTWorksheet sh = wb.getSheetAt(0).getCTWorksheet(); assertNotNull(sh.getPhoneticPr()); } - + /** * Names which are defined with a Sheet * should return that sheet index properly */ @Test public void bug48923() throws Exception { - XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("48923.xlsx"); - assertEquals(4, wb.getNumberOfNames()); - - Name b1 = wb.getName("NameB1"); - Name b2 = wb.getName("NameB2"); - Name sheet2 = wb.getName("NameSheet2"); - Name test = wb.getName("Test"); - - assertNotNull(b1); - assertEquals("NameB1", b1.getNameName()); - assertEquals("Sheet1", b1.getSheetName()); - assertEquals(-1, b1.getSheetIndex()); - - assertNotNull(b2); - assertEquals("NameB2", b2.getNameName()); - assertEquals("Sheet1", b2.getSheetName()); - assertEquals(-1, b2.getSheetIndex()); - - assertNotNull(sheet2); - assertEquals("NameSheet2", sheet2.getNameName()); - assertEquals("Sheet2", sheet2.getSheetName()); - assertEquals(-1, sheet2.getSheetIndex()); - - assertNotNull(test); - assertEquals("Test", test.getNameName()); - assertEquals("Sheet1", test.getSheetName()); - assertEquals(-1, test.getSheetIndex()); + XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("48923.xlsx"); + assertEquals(4, wb.getNumberOfNames()); + + Name b1 = wb.getName("NameB1"); + Name b2 = wb.getName("NameB2"); + Name sheet2 = wb.getName("NameSheet2"); + Name test = wb.getName("Test"); + + assertNotNull(b1); + assertEquals("NameB1", b1.getNameName()); + assertEquals("Sheet1", b1.getSheetName()); + assertEquals(-1, b1.getSheetIndex()); + + assertNotNull(b2); + assertEquals("NameB2", b2.getNameName()); + assertEquals("Sheet1", b2.getSheetName()); + assertEquals(-1, b2.getSheetIndex()); + + assertNotNull(sheet2); + assertEquals("NameSheet2", sheet2.getNameName()); + assertEquals("Sheet2", sheet2.getSheetName()); + assertEquals(-1, sheet2.getSheetIndex()); + + assertNotNull(test); + assertEquals("Test", test.getNameName()); + assertEquals("Sheet1", test.getSheetName()); + assertEquals(-1, test.getSheetIndex()); } - + /** * Problem with evaluation formulas due to * NameXPtgs. @@ -258,77 +274,77 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { */ @Test public void bug48539() throws Exception { - XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("48539.xlsx"); - assertEquals(3, wb.getNumberOfSheets()); - assertEquals(0, wb.getNumberOfNames()); - - // Try each cell individually - XSSFFormulaEvaluator eval = new XSSFFormulaEvaluator(wb); - for(int i=0; i