From: Nick Burch Date: Sun, 9 Aug 2015 12:36:57 +0000 (+0000) Subject: Fix the themes test for the complex workbook X-Git-Tag: REL_3_13_FINAL~151 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f6e262c4fe8036bfc9d2f1fb4bbfa1c2f8beef23;p=poi.git Fix the themes test for the complex workbook git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1694883 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java b/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java index 2a2e78d236..fde748815a 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java @@ -58,7 +58,7 @@ public class TestThemesTable { "f79646", // Accent6 "0000ff", // Hlink "800080" // FolHlink - }; + }; @Test public void testThemesTableColors() throws Exception { @@ -75,9 +75,8 @@ public class TestThemesTable { Map workbooks = new LinkedHashMap(); workbooks.put(testFileSimple, simple); workbooks.put("Re-Saved_" + testFileSimple, simpleRS); - // TODO Fix these to work! -// workbooks.put(testFileComplex, complex); -// workbooks.put("Re-Saved_" + testFileComplex, complexRS); + workbooks.put(testFileComplex, complex); + workbooks.put("Re-Saved_" + testFileComplex, complexRS); // Sanity check assertEquals(rgbExpected.length, rgbExpected.length); @@ -100,8 +99,9 @@ public class TestThemesTable { XSSFCell cell = row.getCell(0); assertNotNull( "Missing cell " + ref + " in " + whatWorkbook, cell); - - ThemeElement themeElem = ThemeElement.byId(rn-startRN); + + int expectedThemeIdx = rn-startRN; + ThemeElement themeElem = ThemeElement.byId(expectedThemeIdx); assertEquals( "Wrong theme at " + ref + " in " + whatWorkbook, themeElem.name.toLowerCase(), cell.getStringCellValue()); @@ -120,9 +120,7 @@ public class TestThemesTable { // Check the RGB part (no tint) assertEquals( "Wrong theme colour " + themeElem.name + " on " + whatWorkbook, - rgbExpected[rn], Hex.encodeHexString(color.getRGB())); - // Check the Theme ID - int expectedThemeIdx = rn - startRN; + rgbExpected[expectedThemeIdx], Hex.encodeHexString(color.getRGB())); long themeIdx = font.getCTFont().getColorArray(0).getTheme(); assertEquals( "Wrong theme index " + expectedThemeIdx + " on " + whatWorkbook,