From 5185ad3b5a22e5dc1161dd00f853c299f128e01a Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 4 Mar 2011 14:38:13 +0000 Subject: Hopefully fix bug #50846 - Improve how XSSFColor inherits from Themes, by pushing the logic out of XSSFCellStyle and into ThemesTable + make it easier to call git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1077968 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/xssf/usermodel/TestXSSFBugs.java | 13 +++++++++++++ .../org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java | 4 ++-- .../org/apache/poi/xssf/usermodel/TestXSSFColor.java | 14 -------------- .../poi/xssf/usermodel/extensions/TestXSSFBorder.java | 2 +- 4 files changed, 16 insertions(+), 17 deletions(-) (limited to 'src/ooxml/testcases/org/apache/poi') 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 3b17b9ac0d..465d164c26 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -725,6 +725,19 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { assertEquals("FFCCFFCC", cs.getFillForegroundColorColor().getARGBHex()); } + /** + * If the border colours are set with themes, then we + * should still be able to get colours + */ + public void test50846() throws Exception { + // TODO Get file and test + //Workbook wb = XSSFTestDataSamples.openSampleWorkbook("50846.xlsx"); + + // Check the style that is theme based + + // Check the one that isn't + } + /** * Fonts where their colours come from the theme rather * then being set explicitly still should allow the diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java index 02b34ae85e..83edc8f2f4 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFCellStyle.java @@ -59,11 +59,11 @@ public class TestXSSFCellStyle extends TestCase { ctStylesheet = stylesTable.getCTStylesheet(); ctBorderA = CTBorder.Factory.newInstance(); - XSSFCellBorder borderA = new XSSFCellBorder(ctBorderA); + XSSFCellBorder borderA = new XSSFCellBorder(ctBorderA, null); long borderId = stylesTable.putBorder(borderA); assertEquals(1, borderId); - XSSFCellBorder borderB = new XSSFCellBorder(); + XSSFCellBorder borderB = new XSSFCellBorder(null); assertEquals(1, stylesTable.putBorder(borderB)); ctFill = CTFill.Factory.newInstance(); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColor.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColor.java index 17b1d0d547..60dfb4f97d 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColor.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFColor.java @@ -19,21 +19,7 @@ package org.apache.poi.xssf.usermodel; import junit.framework.TestCase; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.xssf.XSSFITestDataProvider; import org.apache.poi.xssf.XSSFTestDataSamples; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBooleanProperty; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontName; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontScheme; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontSize; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTIntProperty; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTUnderlineProperty; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTVerticalAlignFontProperty; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.STFontScheme; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.STUnderlineValues; -import org.openxmlformats.schemas.spreadsheetml.x2006.main.STVerticalAlignRun; public final class TestXSSFColor extends TestCase { public void testIndexedColour() throws Exception { diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFBorder.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFBorder.java index e7233c227e..46af27d59d 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFBorder.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/extensions/TestXSSFBorder.java @@ -40,7 +40,7 @@ public class TestXSSFBorder extends TestCase { right.setStyle(STBorderStyle.NONE); bottom.setStyle(STBorderStyle.THIN); - XSSFCellBorder cellBorderStyle = new XSSFCellBorder(border); + XSSFCellBorder cellBorderStyle = new XSSFCellBorder(border, null); assertEquals("DASH_DOT", cellBorderStyle.getBorderStyle(BorderSide.TOP).toString()); assertEquals("NONE", cellBorderStyle.getBorderStyle(BorderSide.RIGHT).toString()); -- cgit v1.2.3