poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From talli...@apache.org
Subject svn commit: r1837742 - in /poi/trunk: 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
Date Thu, 09 Aug 2018 15:50:34 GMT
Author: tallison
Date: Thu Aug  9 15:50:34 2018
New Revision: 1837742

URL: http://svn.apache.org/viewvc?rev=1837742&view=rev
Log:
bug 62591 -- revert to ignoring place holders even if they contain metroblobs in ppt

Added:
    poi/trunk/test-data/slideshow/bug62591.ppt   (with props)
Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java?rev=1837742&r1=1837741&r2=1837742&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java Thu Aug
 9 15:50:34 2018
@@ -704,10 +704,7 @@ implements TextShape<HSLFShape,HSLFTextP
         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));
     }
 
 

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java?rev=1837742&r1=1837741&r2=1837742&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java Thu
Aug  9 15:50:34 2018
@@ -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");
         }
     }
 

Added: poi/trunk/test-data/slideshow/bug62591.ppt
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/slideshow/bug62591.ppt?rev=1837742&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/test-data/slideshow/bug62591.ppt
------------------------------------------------------------------------------
    svn:mime-type = application/vnd.ms-powerpoint



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


Mime
View raw message