diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2017-02-08 01:12:22 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2017-02-08 01:12:22 +0000 |
commit | a002b7287e84ff8d90d49218c764fb75ce4aa118 (patch) | |
tree | 708ac639f7f3e8e33a5a1ee4341873fdba39c3b2 /src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java | |
parent | 7ed2c1e85af772be8821524f9a5599be0f8f7bfa (diff) | |
download | poi-a002b7287e84ff8d90d49218c764fb75ce4aa118.tar.gz poi-a002b7287e84ff8d90d49218c764fb75ce4aa118.zip |
#60625 - Rendering issue with background and shape overlayed by image
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1782096 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java')
-rw-r--r-- | src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java index 8b340079d3..df99363dcc 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java @@ -38,6 +38,7 @@ import java.io.OutputStream; import java.io.PrintStream; import java.text.AttributedCharacterIterator; import java.text.AttributedCharacterIterator.Attribute; +import java.text.CharacterIterator; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -466,12 +467,16 @@ public final class TestBugs { // get slides for (HSLFSlide slide : ppt.getSlides()) { for (HSLFShape shape : slide.getShapes()) { - if (!(shape instanceof HSLFTextBox)) continue; + if (!(shape instanceof HSLFTextBox)) { + continue; + } HSLFTextBox tb = (HSLFTextBox) shape; // work with TextBox String str = tb.getText(); - if (!str.contains("$$DATE$$")) continue; + if (!str.contains("$$DATE$$")) { + continue; + } str = str.replace("$$DATE$$", new Date().toString()); tb.setText(str); @@ -512,7 +517,9 @@ public final class TestBugs { int tha = 0; for (Record r : s1.getSlideRecords()) { - if (r instanceof TextHeaderAtom) tha++; + if (r instanceof TextHeaderAtom) { + tha++; + } } assertEquals(2, tha); @@ -525,7 +532,9 @@ public final class TestBugs { // Will have skipped the empty one int str = 0; for (List<HSLFTextParagraph> tr : _slides.get(0).getTextParagraphs()) { - if (! tr.get(0).isDrawingBased()) str++; + if (! tr.get(0).isDrawingBased()) { + str++; + } } assertEquals(2, str); @@ -758,7 +767,7 @@ public final class TestBugs { public void bug47904() throws IOException { HSLFSlideShow ppt1 = new HSLFSlideShow(); HSLFSlideMaster sm = ppt1.getSlideMasters().get(0); - HSLFAutoShape as = (HSLFAutoShape)sm.getShapes().get(0); + HSLFAutoShape as = (HSLFAutoShape)sm.getPlaceholder(Placeholder.TITLE); HSLFTextParagraph tp = as.getTextParagraphs().get(0); HSLFTextRun tr = tp.getTextRuns().get(0); tr.setFontFamily("Tahoma"); @@ -766,8 +775,9 @@ public final class TestBugs { tr.setFontSize(44.); tr.setFontColor(Color.red); tp.setTextAlign(TextAlign.RIGHT); - ppt1.createSlide().addTitle().setText("foobaa"); - + HSLFTextBox tb = ppt1.createSlide().addTitle(); + tb.setText("foobaa"); + HSLFSlideShow ppt2 = HSLFTestDataSamples.writeOutAndReadBack(ppt1); ppt1.close(); @@ -877,7 +887,7 @@ public final class TestBugs { StringBuffer sb = new StringBuffer(); for (char c = iterator.first(); - c != AttributedCharacterIterator.DONE; + c != CharacterIterator.DONE; c = iterator.next()) { sb.append(c); attributes = iterator.getAttributes(); |