<!-- Don't forget to update status.xml too! -->
<release version="3.1-beta1" date="2008-??-??">
+ <action dev="POI-DEVELOPERS" type="fix">38921 - Have HSSFPalette.findSimilar() work properly</action>
<action dev="POI-DEVELOPERS" type="fix">44456 - Fix the contrib SViewer / SViewerPanel to not fail on sheets with missing rows</action>
<action dev="POI-DEVELOPERS" type="fix">44403 - Further support for unusual, but valid, arguments to the Mid function</action>
<action dev="POI-DEVELOPERS" type="fix">44410 - Support for whole-column ranges, such as C:C, in formula strings and the formula evaluator</action>
<!-- Don't forget to update changes.xml too! -->
<changes>
<release version="3.1-beta1" date="2008-??-??">
+ <action dev="POI-DEVELOPERS" type="fix">38921 - Have HSSFPalette.findSimilar() work properly</action>
<action dev="POI-DEVELOPERS" type="fix">44456 - Fix the contrib SViewer / SViewerPanel to not fail on sheets with missing rows</action>
<action dev="POI-DEVELOPERS" type="fix">44403 - Further support for unusual, but valid, arguments to the Mid function</action>
<action dev="POI-DEVELOPERS" type="fix">44410 - Support for whole-column ranges, such as C:C, in formula strings and the formula evaluator</action>
assertEquals("FFFF:0:FFFF", p.getColor((short)14).getHexString());
}
+ public void testFindSimilar() throws Exception {
+ HSSFWorkbook book = new HSSFWorkbook();
+ HSSFPalette p = book.getCustomPalette();
+
+
+ // Add a few edge colours in
+ p.setColorAtIndex((short)8, (byte)-1, (byte)0, (byte)0);
+ p.setColorAtIndex((short)9, (byte)0, (byte)-1, (byte)0);
+ p.setColorAtIndex((short)10, (byte)0, (byte)0, (byte)-1);
+
+ // And some near a few of them
+ p.setColorAtIndex((short)11, (byte)-1, (byte)2, (byte)2);
+ p.setColorAtIndex((short)12, (byte)-2, (byte)2, (byte)10);
+ p.setColorAtIndex((short)13, (byte)-4, (byte)0, (byte)0);
+ p.setColorAtIndex((short)14, (byte)-8, (byte)0, (byte)0);
+
+ assertEquals(
+ "FFFF:0:0", p.getColor((short)8).getHexString()
+ );
+
+ // Now check we get the right stuff back
+ assertEquals(
+ p.getColor((short)8).getHexString(),
+ p.findSimilarColor((byte)-1, (byte)0, (byte)0).getHexString()
+ );
+ assertEquals(
+ p.getColor((short)8).getHexString(),
+ p.findSimilarColor((byte)-2, (byte)0, (byte)0).getHexString()
+ );
+ assertEquals(
+ p.getColor((short)8).getHexString(),
+ p.findSimilarColor((byte)-1, (byte)1, (byte)0).getHexString()
+ );
+ assertEquals(
+ p.getColor((short)11).getHexString(),
+ p.findSimilarColor((byte)-1, (byte)2, (byte)1).getHexString()
+ );
+ assertEquals(
+ p.getColor((short)12).getHexString(),
+ p.findSimilarColor((byte)-1, (byte)2, (byte)10).getHexString()
+ );
+ }
+
/**
* Verifies that the generated gnumeric-format string values match the
* hardcoded values in the HSSFColor default color palette