]> source.dussan.org Git - poi.git/commitdiff
bug 62591 -- revert to ignoring place holders even if they contain metroblobs in ppt
authorTim Allison <tallison@apache.org>
Thu, 9 Aug 2018 15:50:34 +0000 (15:50 +0000)
committerTim Allison <tallison@apache.org>
Thu, 9 Aug 2018 15:50:34 +0000 (15:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1837742 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java
src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java
test-data/slideshow/bug62591.ppt [new file with mode: 0644]

index d3dbf144ef47f6709030bc0dc77b616a913e46e7..412bc1ff49044559ee7ecc4904af5a7b5814f2f7 100644 (file)
@@ -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));
     }
 
 
index 9a420a6e267722f5142f4d124251b40baedcb037..1f709d969b5dca22b0240639ac97a2198ba8dd60 100644 (file)
@@ -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");
         }
     }
 
diff --git a/test-data/slideshow/bug62591.ppt b/test-data/slideshow/bug62591.ppt
new file mode 100644 (file)
index 0000000..44dac3f
Binary files /dev/null and b/test-data/slideshow/bug62591.ppt differ