Author: abearez
Date: Mon Mar  2 23:57:01 2020
New Revision: 1874704

URL: http://svn.apache.org/viewvc?rev=1874704&view=rev
Log:
Remove chart title when given text is null

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFTitle.java

Modified: 
poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFTitle.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFTitle.java?rev=1874704&r1=1874703&r2=1874704&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFTitle.java 
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xddf/usermodel/chart/XDDFTitle.java 
Mon Mar  2 23:57:01 2020
@@ -58,10 +58,16 @@ public class XDDFTitle {
     }
 
     public void setText(String text) {
-        if (!title.isSetLayout()) {
-            title.addNewLayout();
+        if (text == null) {
+            if (title.isSetTx()) {
+                title.unsetTx();
+            }
+        } else{
+            if (!title.isSetLayout()) {
+                title.addNewLayout();
+            }
+            getBody().setText(text);
         }
-        getBody().setText(text);
     }
 
     public void setOverlay(Boolean overlay) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org
For additional commands, e-mail: commits-h...@poi.apache.org

Reply via email to