From: PJ Fanning Date: Sat, 4 Jul 2020 23:02:18 +0000 (+0000) Subject: try to fix issue with missing classes in poi-ooxml-schemas X-Git-Tag: before_ooxml_3rd_edition~202 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1c5ba18ac099cdee10d2f5a704a5ba8ad760bf28;p=poi.git try to fix issue with missing classes in poi-ooxml-schemas git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1879507 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFErrorBars.java b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFErrorBars.java index 807afc080a..108793d0ce 100644 --- a/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFErrorBars.java +++ b/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFErrorBars.java @@ -88,7 +88,7 @@ public class XDDFErrorBars { } public ErrorBarType getErrorBarType() { - return ErrorBarType.valueOf(bars.getErrBarType().getVal()); + return bars.getErrBarType() == null ? null : ErrorBarType.valueOf(bars.getErrBarType().getVal()); } public void setErrorBarType(ErrorBarType barType) { @@ -96,7 +96,7 @@ public class XDDFErrorBars { } public ErrorValueType getErrorValueType() { - return ErrorValueType.valueOf(bars.getErrValType().getVal()); + return bars.getErrValType() == null ? null : ErrorValueType.valueOf(bars.getErrValType().getVal()); } public void setErrorValueType(ErrorValueType valueType) { diff --git a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestNecessaryOOXMLClasses.java b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestNecessaryOOXMLClasses.java index 225aaece6c..e6b1589b58 100644 --- a/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestNecessaryOOXMLClasses.java +++ b/src/ooxml/testcases/org/apache/poi/xddf/usermodel/TestNecessaryOOXMLClasses.java @@ -166,7 +166,11 @@ public class TestNecessaryOOXMLClasses { Assert.assertNotNull(ErrorBarType.BOTH); Assert.assertNotNull(ErrorValueType.CUSTOM); Assert.assertNotNull(ErrorDirection.X); - Assert.assertNotNull(new XDDFErrorBars()); + XDDFErrorBars xeb = new XDDFErrorBars(); + Assert.assertNotNull(xeb); + Assert.assertNull(xeb.getErrorBarType()); + Assert.assertNull(xeb.getErrorDirection()); + Assert.assertNull(xeb.getErrorValueType()); STErrBarType.Enum e9 = STErrBarType.Enum.forString("both"); Assert.assertNotNull(e9); STErrValType.Enum e10 = STErrValType.Enum.forString("percentage");