poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1702800 - in /poi/trunk: src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java test-data/spreadsheet/55406_Conditional_formatting_sample.xlsx
Date Sun, 13 Sep 2015 19:05:30 GMT
Author: centic
Date: Sun Sep 13 19:05:28 2015
New Revision: 1702800

URL: http://svn.apache.org/r1702800
Log:
Verify that bug 55406 can be closed WORKSFORME

Added:
    poi/trunk/test-data/spreadsheet/55406_Conditional_formatting_sample.xlsx
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=1702800&r1=1702799&r2=1702800&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 Sun Sep
13 19:05:28 2015
@@ -81,6 +81,7 @@ import org.apache.poi.ss.usermodel.Name;
 import org.apache.poi.ss.usermodel.PrintSetup;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.SheetConditionalFormatting;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.ss.usermodel.WorkbookFactory;
 import org.apache.poi.ss.util.AreaReference;
@@ -2783,4 +2784,30 @@ public final class TestXSSFBugs extends
 
         wb.close();
     }
+
+    @Test
+    public void test55406() {
+        Workbook wb = XSSFTestDataSamples.openSampleWorkbook("55406_Conditional_formatting_sample.xlsx");
+        Sheet sheet = wb.getSheetAt(0);
+        Cell cellA1 = sheet.getRow(0).getCell(0);
+        Cell cellA2 = sheet.getRow(1).getCell(0);
+        
+        assertEquals(0, cellA1.getCellStyle().getFillForegroundColor());
+        assertEquals("FFFDFDFD", ((XSSFColor)cellA1.getCellStyle().getFillForegroundColorColor()).getARGBHex());
+        assertEquals(0, cellA2.getCellStyle().getFillForegroundColor());
+        assertEquals("FFFDFDFD", ((XSSFColor)cellA2.getCellStyle().getFillForegroundColorColor()).getARGBHex());
+        
+        SheetConditionalFormatting cond = sheet.getSheetConditionalFormatting();
+        assertEquals(2, cond.getNumConditionalFormattings());
+
+        assertEquals(1, cond.getConditionalFormattingAt(0).getNumberOfRules());
+        assertEquals(64, cond.getConditionalFormattingAt(0).getRule(0).getPatternFormatting().getFillForegroundColor());
+        assertEquals("ISEVEN(ROW())", cond.getConditionalFormattingAt(0).getRule(0).getFormula1());
+        assertNull(((XSSFColor)cond.getConditionalFormattingAt(0).getRule(0).getPatternFormatting().getFillForegroundColorColor()).getARGBHex());
+
+        assertEquals(1, cond.getConditionalFormattingAt(1).getNumberOfRules());
+        assertEquals(64, cond.getConditionalFormattingAt(1).getRule(0).getPatternFormatting().getFillForegroundColor());

+        assertEquals("ISEVEN(ROW())", cond.getConditionalFormattingAt(1).getRule(0).getFormula1());
+        assertNull(((XSSFColor)cond.getConditionalFormattingAt(1).getRule(0).getPatternFormatting().getFillForegroundColorColor()).getARGBHex());

+    }
 }

Added: poi/trunk/test-data/spreadsheet/55406_Conditional_formatting_sample.xlsx
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/55406_Conditional_formatting_sample.xlsx?rev=1702800&view=auto
==============================================================================
Binary files poi/trunk/test-data/spreadsheet/55406_Conditional_formatting_sample.xlsx (added)
and poi/trunk/test-data/spreadsheet/55406_Conditional_formatting_sample.xlsx Sun Sep 13 19:05:28
2015 differ



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message