diff options
author | Tim Allison <tallison@apache.org> | 2018-08-09 15:50:34 +0000 |
---|---|---|
committer | Tim Allison <tallison@apache.org> | 2018-08-09 15:50:34 +0000 |
commit | 9ae7bdd2cd02cf588a96a75102c6201113a99bfa (patch) | |
tree | b1e1609a5a956cc0039d5c41e86b3d1e54bec5f9 /src/scratchpad | |
parent | ede566d9c0204727293931a9e089321f37c9c14b (diff) | |
download | poi-9ae7bdd2cd02cf588a96a75102c6201113a99bfa.tar.gz poi-9ae7bdd2cd02cf588a96a75102c6201113a99bfa.zip |
bug 62591 -- revert to ignoring place holders even if they contain metroblobs in ppt
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837742 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/scratchpad')
-rw-r--r-- | src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java | 5 | ||||
-rw-r--r-- | src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java | 21 |
2 files changed, 20 insertions, 6 deletions
diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java index d3dbf144ef..412bc1ff49 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java @@ -704,10 +704,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> { return ((getPlaceholderAtom() != null) || //special case for files saved in Office 2007 - (getHFPlaceholderAtom() != null)) && - // check for metro shape of complex placeholder - (!new HSLFMetroShape<HSLFShape>(this).hasMetroBlob()) - ; + (getHFPlaceholderAtom() != null)); } diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java b/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java index 9a420a6e26..1f709d969b 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java @@ -309,7 +309,6 @@ public final class TestExtractor { } } - @SuppressWarnings("unused") @Test public void testSlideMasterText() throws IOException { String masterTitleText = "This is the Master Title"; @@ -320,7 +319,25 @@ public final class TestExtractor { String text = ppe.getText(); assertContains(text, masterRandomText); - assertContains(text, masterFooterText); + assertNotContained(text, masterTitleText); + + //make sure that the footer only appears once + int masterFooters = 0; + int offset = text.indexOf(masterFooterText); + while (offset > -1) { + masterFooters++; + offset = text.indexOf(masterFooterText, offset+1); + } + assertEquals(1, masterFooters); + } + } + + @Test + public void testSlideMasterText2() throws IOException { + try (final SlideShowExtractor ppe = openExtractor("bug62591.ppt")) { + ppe.setMasterByDefault(true); + String text = ppe.getText(); + assertNotContained(text, "Titelmasterformat"); } } |