You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2011/02/18 16:46:00 UTC
svn commit: r1072027 - in /poi/trunk:
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
test-data/spreadsheet/50784-font_theme_colours.xlsx
Author: nick
Date: Fri Feb 18 15:45:59 2011
New Revision: 1072027
URL: http://svn.apache.org/viewvc?rev=1072027&view=rev
Log:
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
Added:
poi/trunk/test-data/spreadsheet/50784-font_theme_colours.xlsx (with props)
Modified:
poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java?rev=1072027&r1=1072026&r2=1072027&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java Fri Feb 18 15:45:59 2011
@@ -672,4 +672,35 @@ public final class TestXSSFBugs extends
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
+ }
}
Added: poi/trunk/test-data/spreadsheet/50784-font_theme_colours.xlsx
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/50784-font_theme_colours.xlsx?rev=1072027&view=auto
==============================================================================
Binary file - no diff available.
Propchange: poi/trunk/test-data/spreadsheet/50784-font_theme_colours.xlsx
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org