aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2011-02-18 15:45:59 +0000
committerNick Burch <nick@apache.org>2011-02-18 15:45:59 +0000
commitabf0d84ead6326fba1cae643db29f67ec195141f (patch)
tree4e3159506cbcd180128efd9dab4c37886d4094d8
parent51653729ce39bab500b910cfc4ee07e21fe2beaf (diff)
downloadpoi-abf0d84ead6326fba1cae643db29f67ec195141f.tar.gz
poi-abf0d84ead6326fba1cae643db29f67ec195141f.zip
Add a disabled unit test for bug #50784. We need to add support for XSSF Colours to pull details from their parent theme where there is one
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1072027 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java31
-rw-r--r--test-data/spreadsheet/50784-font_theme_colours.xlsxbin0 -> 12342 bytes
2 files changed, 31 insertions, 0 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 abc9fc73bc..9f8909ea61 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
@@ -672,4 +672,35 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
comment = cellWithoutComment.getCellComment();
assertEquals(exp, comment.getString().getString());
}
+
+ /**
+ * Fonts where their colours come from the theme rather
+ * then being set explicitly still should allow the
+ * fetching of the RGB
+ */
+ public void DISABLEDtest50784() throws Exception {
+ XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("50784-font_theme_colours.xlsx");
+ XSSFSheet s = wb.getSheetAt(0);
+ XSSFRow r = s.getRow(0);
+
+ // Column 1 has a font with regular colours
+ XSSFCell cr = r.getCell(1);
+ XSSFFont fr = wb.getFontAt( cr.getCellStyle().getFontIndex() );
+ XSSFColor colr = fr.getXSSFColor();
+ // No theme, has colours
+ assertEquals(0, colr.getTheme());
+ assertNotNull( colr.getRgb() );
+
+ // Column 0 has a font with colours from a theme
+ XSSFCell ct = r.getCell(0);
+ XSSFFont ft = wb.getFontAt( ct.getCellStyle().getFontIndex() );
+ XSSFColor colt = ft.getXSSFColor();
+ // Has a theme, which has the colours on it
+ assertEquals(9, colt.getTheme());
+ XSSFColor themeC = wb.getTheme().getThemeColor(colt.getTheme());
+ assertNotNull( themeC.getRgb() );
+ // TODO Fix it so this works
+ assertNotNull( colt.getRgb() );
+ assertEquals( themeC.getRgb(), colt.getRgb() ); // The same colour
+ }
}
diff --git a/test-data/spreadsheet/50784-font_theme_colours.xlsx b/test-data/spreadsheet/50784-font_theme_colours.xlsx
new file mode 100644
index 0000000000..72e2dbbf14
--- /dev/null
+++ b/test-data/spreadsheet/50784-font_theme_colours.xlsx
Binary files differ