aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2015-09-13 19:05:28 +0000
committerDominik Stadler <centic@apache.org>2015-09-13 19:05:28 +0000
commitcda2a2b63d12ff3b399f2122ac4d94483d6a8964 (patch)
treed29cb59c09625d966b0a0efbc0d316ac9ae3f51a
parent19246eb4a3d0f78219d6e861b9db63e243ab3f2f (diff)
downloadpoi-cda2a2b63d12ff3b399f2122ac4d94483d6a8964.tar.gz
poi-cda2a2b63d12ff3b399f2122ac4d94483d6a8964.zip
Verify that bug 55406 can be closed WORKSFORME
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1702800 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java27
-rw-r--r--test-data/spreadsheet/55406_Conditional_formatting_sample.xlsxbin0 -> 12646 bytes
2 files changed, 27 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 d6f573c1ca..c7a5486cc8 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
@@ -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 BaseTestBugzillaIssues {
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());
+ }
}
diff --git a/test-data/spreadsheet/55406_Conditional_formatting_sample.xlsx b/test-data/spreadsheet/55406_Conditional_formatting_sample.xlsx
new file mode 100644
index 0000000000..dc3e96d628
--- /dev/null
+++ b/test-data/spreadsheet/55406_Conditional_formatting_sample.xlsx
Binary files differ