Browse Source

Provide more output when failing range-checks on HSL2RGB-construction

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1694960 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_3_13_FINAL
Dominik Stadler 8 years ago
parent
commit
179ed9ea12

+ 2
- 3
src/integrationtest/org/apache/poi/stress/XSLFFileHandler.java View File

@@ -97,7 +97,7 @@ public class XSLFFileHandler extends AbstractFileHandler {
// a test-case to test this locally without executing the full TestAllFiles
@Test
public void test() throws Exception {
InputStream stream = new FileInputStream("test-data/slideshow/SampleShow.pptx");
InputStream stream = new FileInputStream("test-data/slideshow/ae.ac.uaeu.faculty_nafaachbili_GeomLec1.pptx");
try {
handleFile(stream);
} finally {
@@ -105,10 +105,9 @@ public class XSLFFileHandler extends AbstractFileHandler {
}
}


// a test-case to test this locally without executing the full TestAllFiles
@Test
public void testExtractor() throws Exception {
handleExtracting(new File("test-data/slideshow/testPPT.thmx"));
handleExtracting(new File("test-data/slideshow/ae.ac.uaeu.faculty_nafaachbili_GeomLec1.pptx"));
}
}

+ 3
- 3
src/java/org/apache/poi/sl/draw/DrawPaint.java View File

@@ -357,17 +357,17 @@ public class DrawPaint {
*/
private static Color HSL2RGB(double h, double s, double l, double alpha) {
if (s <0.0f || s > 100.0f) {
String message = "Color parameter outside of expected range - Saturation";
String message = "Color parameter outside of expected range - Saturation: " + s;
throw new IllegalArgumentException( message );
}
if (l <0.0f || l > 100.0f) {
String message = "Color parameter outside of expected range - Luminance";
String message = "Color parameter outside of expected range - Luminance: " + l;
throw new IllegalArgumentException( message );
}
if (alpha <0.0f || alpha > 1.0f) {
String message = "Color parameter outside of expected range - Alpha";
String message = "Color parameter outside of expected range - Alpha: " + alpha;
throw new IllegalArgumentException( message );
}

Loading…
Cancel
Save