diff options
author | PJ Fanning <fanningpj@apache.org> | 2022-07-27 08:59:25 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2022-07-27 08:59:25 +0000 |
commit | 1ce0f77bdd4b7c230fe1a08bc35c40d09ae1488d (patch) | |
tree | f5caab781c31aea5cc674b372f45092990e7aa06 /poi-ooxml | |
parent | cee18e78b5f883c6d9de6dc363196b2e3301dad0 (diff) | |
download | poi-1ce0f77bdd4b7c230fe1a08bc35c40d09ae1488d.tar.gz poi-1ce0f77bdd4b7c230fe1a08bc35c40d09ae1488d.zip |
[bug-66176] rework text box support
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903047 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFDiagram.java | 1 | ||||
-rw-r--r-- | poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFDiagram.java | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFDiagram.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFDiagram.java index f1073e31ce..c63e6ca0ac 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFDiagram.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFDiagram.java @@ -180,6 +180,7 @@ public class XSLFDiagram extends XSLFGraphicFrame { // If we shared the one object, a consumer may be surprised that updating the text shape properties // also updates the parent shape. textShapeCT.setNvSpPr((CTShapeNonVisual) nonVisualCt.copy()); + textShapeCT.getNvSpPr().getCNvSpPr().setTxBox(true); return textShapeCT; } diff --git a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFDiagram.java b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFDiagram.java index d8b1a655c9..9552cfd656 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFDiagram.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFDiagram.java @@ -107,7 +107,7 @@ public class TestXSLFDiagram { assertTrue(yellowCircle.getText().isEmpty()); assertEquals(accent4Hex, colorToHex(yellowCircle.getFillColor())); - XSLFAutoShape yellowCircleText = (XSLFAutoShape) shapes.get(1); + XSLFTextBox yellowCircleText = (XSLFTextBox) shapes.get(1); assertEquals(yellowCircleText.getText(), "abc"); assertEquals(TextAlign.CENTER, yellowCircleText.getTextParagraphs().get(0).getTextAlign()); @@ -116,7 +116,7 @@ public class TestXSLFDiagram { assertTrue(gradientCircle.getFillPaint() instanceof PaintStyle.GradientPaint); assertTrue(gradientCircle.getText().isEmpty()); - XSLFAutoShape gradientCircleText = (XSLFAutoShape) shapes.get(3); + XSLFTextBox gradientCircleText = (XSLFTextBox) shapes.get(3); assertEquals(gradientCircleText.getText(), "def"); // Even with left justification, the text is rendered on the right side of the circle because SmartArt defines // a better visual placement for the textbox inside the txXfrm property. @@ -138,7 +138,7 @@ public class TestXSLFDiagram { assertEquals(6405, greenCircleColorStyle.getLumOff()); assertEquals(-27185, greenCircleColorStyle.getSatOff()); - XSLFAutoShape greenCircleText = (XSLFAutoShape) shapes.get(5); + XSLFTextBox greenCircleText = (XSLFTextBox) shapes.get(5); assertEquals(greenCircleText.getText(), "ghi"); assertEquals(TextAlign.RIGHT, greenCircleText.getTextParagraphs().get(0).getTextAlign()); |