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/05/20 22:46:55 UTC

svn commit: r1125559 - in /poi/trunk: src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java test-data/spreadsheet/51222.xlsx

Author: nick
Date: Fri May 20 20:46:55 2011
New Revision: 1125559

URL: http://svn.apache.org/viewvc?rev=1125559&view=rev
Log:
Test that shows that bug #51222 is a themes colour problem

Added:
    poi/trunk/test-data/spreadsheet/51222.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=1125559&r1=1125558&r2=1125559&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 May 20 20:46:55 2011
@@ -1173,4 +1173,45 @@ public final class TestXSSFBugs extends 
        // Complex file
        // TODO
     }
+    
+    /**
+     * Colours and styles when the list has gaps in it 
+     */
+    public void test51222() throws Exception {
+       XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("51222.xlsx");
+       XSSFSheet s = wb.getSheetAt(0);
+       
+       XSSFCell cA4_EEECE1 = s.getRow(3).getCell(0);
+       XSSFCell cA5_1F497D = s.getRow(4).getCell(0);
+       
+       // Check the text
+       assertEquals("A4", cA4_EEECE1.getRichStringCellValue().getString());
+       assertEquals("A5", cA5_1F497D.getRichStringCellValue().getString());
+       
+       // Check the styles assigned to them
+       assertEquals(4, cA4_EEECE1.getCTCell().getS());
+       assertEquals(5, cA5_1F497D.getCTCell().getS());
+       
+       // Check we look up the correct style
+       assertEquals(4, cA4_EEECE1.getCellStyle().getIndex());
+       assertEquals(5, cA5_1F497D.getCellStyle().getIndex());
+       
+       // Check the fills on them at the low level
+       assertEquals(5, cA4_EEECE1.getCellStyle().getCoreXf().getFillId());
+       assertEquals(6, cA5_1F497D.getCellStyle().getCoreXf().getFillId());
+
+       // These should reference themes 2 and 3
+       assertEquals(2, wb.getStylesSource().getFillAt(5).getCTFill().getPatternFill().getFgColor().getTheme());
+       assertEquals(3, wb.getStylesSource().getFillAt(6).getCTFill().getPatternFill().getFgColor().getTheme());
+       
+       // Ensure we get the right colours for these themes
+       // TODO fix
+//       assertEquals("FFEEECE1", wb.getTheme().getThemeColor(2).getARGBHex());
+//       assertEquals("FF1F497D", wb.getTheme().getThemeColor(3).getARGBHex());
+       
+       // Finally check the colours on the styles
+       // TODO fix
+//       assertEquals("FFEEECE1", cA4_EEECE1.getCellStyle().getFillForegroundXSSFColor().getARGBHex());
+//       assertEquals("FF1F497D", cA5_1F497D.getCellStyle().getFillForegroundXSSFColor().getARGBHex());
+    }
 }

Added: poi/trunk/test-data/spreadsheet/51222.xlsx
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/51222.xlsx?rev=1125559&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/test-data/spreadsheet/51222.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