From 1c5ba18ac099cdee10d2f5a704a5ba8ad760bf28 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sat, 4 Jul 2020 23:02:18 +0000 Subject: [PATCH] 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 --- .../org/apache/poi/xddf/usermodel/chart/XDDFErrorBars.java | 4 ++-- .../poi/xddf/usermodel/TestNecessaryOOXMLClasses.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) 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"); -- 2.39.5