poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1766746 - in /poi: site/src/documentation/content/xdocs/ trunk/src/ooxml/java/org/apache/poi/xslf/extractor/ trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/ trunk/src/ooxml/testcases/org/apache/poi/xslf/ trunk/src/ooxml/testcases/org/a...
Date Wed, 26 Oct 2016 22:32:47 GMT
Author: kiwiwings
Date: Wed Oct 26 22:32:46 2016
New Revision: 1766746

URL: http://svn.apache.org/viewvc?rev=1766746&view=rev
Log:
Bug 60059 - Deprecate xslf.usermodel.Drawing* - was: Can't change text of DrawingParagraph

Modified:
    poi/site/src/documentation/content/xdocs/status.xml
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingParagraph.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTable.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTableCell.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTableRow.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTextBody.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTextPlaceholder.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java

Modified: poi/site/src/documentation/content/xdocs/status.xml
URL: http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/status.xml?rev=1766746&r1=1766745&r2=1766746&view=diff
==============================================================================
--- poi/site/src/documentation/content/xdocs/status.xml (original)
+++ poi/site/src/documentation/content/xdocs/status.xml Wed Oct 26 22:32:46 2016
@@ -60,6 +60,7 @@
         <summary-item>Document each major change in the release notes in a summary
item</summary-item>
       </summary -->
       <actions>
+      	<action dev="PD" type="remove" fixes-bug="60059" module="XSLF">Deprecate xslf.usermodel.Drawing*
- was: Can't change text of DrawingParagraph</action>
         <action dev="PD" type="add" module="HDGF">Partial v5 Pointer and Text Extraction
support</action>
         <action dev="PD" type="fix" fixes-bug="60294" module="HSLF">Add "unknown" ShapeType
for 4095</action>
         <action dev="PD" type="fix" fixes-bug="60289" module="XSSF">Fix handling of
rich-text unicode escapes with lowercase hex-chars</action>

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java?rev=1766746&r1=1766745&r2=1766746&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java Wed
Oct 26 22:32:46 2016
@@ -17,24 +17,25 @@
 package org.apache.poi.xslf.extractor;
 
 import java.io.IOException;
-import java.util.List;
 
 import org.apache.poi.POIXMLTextExtractor;
 import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
 import org.apache.poi.openxml4j.opc.OPCPackage;
-import org.apache.poi.xslf.usermodel.DrawingParagraph;
-import org.apache.poi.xslf.usermodel.DrawingTextBody;
-import org.apache.poi.xslf.usermodel.DrawingTextPlaceholder;
 import org.apache.poi.xslf.usermodel.XMLSlideShow;
 import org.apache.poi.xslf.usermodel.XSLFCommentAuthors;
 import org.apache.poi.xslf.usermodel.XSLFComments;
-import org.apache.poi.xslf.usermodel.XSLFCommonSlideData;
 import org.apache.poi.xslf.usermodel.XSLFNotes;
 import org.apache.poi.xslf.usermodel.XSLFRelation;
+import org.apache.poi.xslf.usermodel.XSLFShape;
+import org.apache.poi.xslf.usermodel.XSLFShapeContainer;
 import org.apache.poi.xslf.usermodel.XSLFSlide;
 import org.apache.poi.xslf.usermodel.XSLFSlideLayout;
 import org.apache.poi.xslf.usermodel.XSLFSlideMaster;
 import org.apache.poi.xslf.usermodel.XSLFSlideShow;
+import org.apache.poi.xslf.usermodel.XSLFTable;
+import org.apache.poi.xslf.usermodel.XSLFTableCell;
+import org.apache.poi.xslf.usermodel.XSLFTableRow;
+import org.apache.poi.xslf.usermodel.XSLFTextShape;
 import org.apache.xmlbeans.XmlException;
 import org.openxmlformats.schemas.presentationml.x2006.main.CTComment;
 import org.openxmlformats.schemas.presentationml.x2006.main.CTCommentAuthor;
@@ -115,84 +116,108 @@ public class XSLFPowerPointExtractor ext
    
    /**
     * Gets the requested text from the file
+    * 
     * @param slideText Should we retrieve text from slides?
     * @param notesText Should we retrieve text from notes?
     * @param masterText Should we retrieve text from master slides?
+    * 
+    * @return the extracted text
     */
    public String getText(boolean slideText, boolean notesText, boolean masterText) {
-      StringBuffer text = new StringBuffer();
+      StringBuilder text = new StringBuilder();
 
-      List<XSLFSlide> slides = slideshow.getSlides();
-      XSLFCommentAuthors commentAuthors = slideshow.getCommentAuthors();
+      for (XSLFSlide slide : slideshow.getSlides()) {
+          text.append(getText(slide, slideText, notesText, masterText));
+      }
 
-      for (XSLFSlide slide : slides) {
-         try {
-            XSLFNotes notes = slide.getNotes();
-            XSLFComments comments = slide.getComments();
-            XSLFSlideLayout layout = slide.getSlideLayout();
-            XSLFSlideMaster master = layout.getSlideMaster();
-
-            // TODO Do the slide's name
-            // (Stored in docProps/app.xml)
-
-            // Do the slide's text if requested
-            if (slideText) {
-               extractText(slide.getCommonSlideData(), false, text);
-               
-               // If requested, get text from the master and it's layout 
-               if(masterText) {
-                  if(layout != null) {
-                     extractText(layout.getCommonSlideData(), true, text);
-                  }
-                  if(master != null) {
-                     extractText(master.getCommonSlideData(), true, text);
-                  }
-               }
+      return text.toString();
+   }
 
-               // If the slide has comments, do those too
-               if (comments != null) {
-                  for (CTComment comment : comments.getCTCommentsList().getCmArray()) {
-                     // Do the author if we can
-                     if (commentAuthors != null) {
-                        CTCommentAuthor author = commentAuthors.getAuthorById(comment.getAuthorId());
-                        if(author != null) {
-                           text.append(author.getName() + ": ");
-                        }
-                     }
-                     
-                     // Then the comment text, with a new line afterwards
-                     text.append(comment.getText());
-                     text.append("\n");
-                  }
-               }
-            }
+   /**
+    * Gets the requested text from the slide
+    * 
+    * @param slide the slide to retrieve the text from
+    * @param slideText Should we retrieve text from slides?
+    * @param notesText Should we retrieve text from notes?
+    * @param masterText Should we retrieve text from master slides?
+    * 
+    * @return the extracted text
+    */
+   public static String getText(XSLFSlide slide, boolean slideText, boolean notesText, boolean
masterText) {
+       StringBuilder text = new StringBuilder();
 
-            // Do the notes if requested
-            if (notesText && notes != null) {
-               extractText(notes.getCommonSlideData(), false, text);
-            }
-         } catch (Exception e) {
-            throw new RuntimeException(e);
-         }
-      }
+       XSLFCommentAuthors commentAuthors = slide.getSlideShow().getCommentAuthors();
 
-      return text.toString();
+       XSLFNotes notes = slide.getNotes();
+       XSLFComments comments = slide.getComments();
+       XSLFSlideLayout layout = slide.getSlideLayout();
+       XSLFSlideMaster master = layout.getSlideMaster();
+
+       // TODO Do the slide's name
+       // (Stored in docProps/app.xml)
+
+       // Do the slide's text if requested
+       if (slideText) {
+          extractText(slide, false, text);
+          
+          // If requested, get text from the master and it's layout 
+          if(masterText) {
+             if(layout != null) {
+                extractText(layout, true, text);
+             }
+             if(master != null) {
+                extractText(master, true, text);
+             }
+          }
+
+          // If the slide has comments, do those too
+          if (comments != null) {
+             for (CTComment comment : comments.getCTCommentsList().getCmArray()) {
+                // Do the author if we can
+                if (commentAuthors != null) {
+                   CTCommentAuthor author = commentAuthors.getAuthorById(comment.getAuthorId());
+                   if(author != null) {
+                      text.append(author.getName() + ": ");
+                   }
+                }
+                
+                // Then the comment text, with a new line afterwards
+                text.append(comment.getText());
+                text.append("\n");
+             }
+          }
+       }
+
+       // Do the notes if requested
+       if (notesText && notes != null) {
+          extractText(notes, false, text);
+       }
+       
+       return text.toString();
    }
-	
-	private void extractText(XSLFCommonSlideData data, boolean skipPlaceholders, StringBuffer
text) {
-	   for(DrawingTextBody textBody : data.getDrawingText()) {
-	      if(skipPlaceholders && textBody instanceof DrawingTextPlaceholder) {
-	         DrawingTextPlaceholder ph = (DrawingTextPlaceholder)textBody;
-	         if(! ph.isPlaceholderCustom()) {
-	            // Skip non-customised placeholder text
-	            continue;
-	         }
-	      }
-	      
-	      for (DrawingParagraph p : textBody.getParagraphs()) {
-            text.append(p.getText());
-            text.append("\n");
-	      }
-	   }
+   
+    private static void extractText(XSLFShapeContainer data, boolean skipPlaceholders, StringBuilder
text) {
+       for (XSLFShape s : data) {
+           if (s instanceof XSLFShapeContainer) {
+               extractText((XSLFShapeContainer)s, skipPlaceholders, text);
+           } else if (s instanceof XSLFTextShape) {
+               XSLFTextShape ts = (XSLFTextShape)s;
+               // Skip non-customised placeholder text
+               if (!(skipPlaceholders && ts.isPlaceholder())) {
+                   text.append(ts.getText());
+                   text.append("\n");
+               }
+           } else if (s instanceof XSLFTable) {
+               XSLFTable ts = (XSLFTable)s;
+               // Skip non-customised placeholder text
+               for (XSLFTableRow r : ts) {
+                   for (XSLFTableCell c : r) {
+                       text.append(c.getText());
+                       text.append("\t");
+                   }
+                   text.append("\n");
+               }
+           }
+       }
 	}
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingParagraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingParagraph.java?rev=1766746&r1=1766745&r2=1766746&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingParagraph.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingParagraph.java Wed Oct 26
22:32:46 2016
@@ -17,12 +17,17 @@
 
 package org.apache.poi.xslf.usermodel;
 
+import org.apache.poi.util.Removal;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlObject;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTTextLineBreak;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph;
 
+/*
+ * @deprecated POI 3.16 beta 1. Instead iterate over the shapes/notes of the slides
+ */
+@Removal(version="3.18")
 public class DrawingParagraph {
     private final CTTextParagraph p;
 

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTable.java?rev=1766746&r1=1766745&r2=1766746&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTable.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTable.java Wed Oct 26 22:32:46
2016
@@ -17,9 +17,14 @@
 
 package org.apache.poi.xslf.usermodel;
 
+import org.apache.poi.util.Removal;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTTable;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTTableRow;
 
+/*
+ * @deprecated POI 3.16 beta 1. use {@link XSLFTable} instead
+ */
+@Removal(version="3.18")
 public class DrawingTable {
     private final CTTable table;
 

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTableCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTableCell.java?rev=1766746&r1=1766745&r2=1766746&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTableCell.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTableCell.java Wed Oct 26
22:32:46 2016
@@ -17,8 +17,13 @@
 
 package org.apache.poi.xslf.usermodel;
 
+import org.apache.poi.util.Removal;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTTableCell;
 
+/*
+ * @deprecated POI 3.16 beta 1. use {@link XSLFTable} instead
+ */
+@Removal(version="3.18")
 public class DrawingTableCell {
     private final CTTableCell cell;
     private final DrawingTextBody drawingTextBody;

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTableRow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTableRow.java?rev=1766746&r1=1766745&r2=1766746&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTableRow.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTableRow.java Wed Oct 26
22:32:46 2016
@@ -17,9 +17,14 @@
 
 package org.apache.poi.xslf.usermodel;
 
+import org.apache.poi.util.Removal;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTTableCell;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTTableRow;
 
+/*
+ * @deprecated POI 3.16 beta 1. use {@link XSLFTable} instead
+ */
+@Removal(version="3.18")
 public class DrawingTableRow {
     private final CTTableRow row;
 

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTextBody.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTextBody.java?rev=1766746&r1=1766745&r2=1766746&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTextBody.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTextBody.java Wed Oct 26
22:32:46 2016
@@ -17,9 +17,14 @@
 
 package org.apache.poi.xslf.usermodel;
 
+import org.apache.poi.util.Removal;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph;
 
+/*
+ * @deprecated POI 3.16 beta 1. use {@link XSLFTable} instead
+ */
+@Removal(version="3.18")
 public class DrawingTextBody {
     private final CTTextBody textBody;
 

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTextPlaceholder.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTextPlaceholder.java?rev=1766746&r1=1766745&r2=1766746&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTextPlaceholder.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingTextPlaceholder.java Wed
Oct 26 22:32:46 2016
@@ -17,6 +17,7 @@
 
 package org.apache.poi.xslf.usermodel;
 
+import org.apache.poi.util.Removal;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody;
 import org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder;
 import org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderType;
@@ -26,6 +27,10 @@ import org.openxmlformats.schemas.presen
  * @author nick
  *
  */
+/*
+ * @deprecated POI 3.16 beta 1. use ??? instead
+ */
+@Removal(version="3.18")
 public class DrawingTextPlaceholder extends DrawingTextBody {
     private final CTPlaceholder placeholder;
 

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java?rev=1766746&r1=1766745&r2=1766746&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java Wed Oct
26 22:32:46 2016
@@ -25,6 +25,7 @@ import java.util.List;
 
 import org.apache.poi.POIXMLException;
 import org.apache.poi.util.Beta;
+import org.apache.poi.util.Removal;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
@@ -38,6 +39,10 @@ import org.openxmlformats.schemas.presen
 import org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape;
 import org.openxmlformats.schemas.presentationml.x2006.main.CTShape;
 
+/*
+ * @deprecated POI 3.16 beta 1. - iterate over the shapes of a slide instead
+ */
+@Removal(version="3.18")
 @Beta
 public class XSLFCommonSlideData {
     private final CTCommonSlideData data;

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java?rev=1766746&r1=1766745&r2=1766746&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java Wed Oct 26 22:32:46
2016
@@ -47,6 +47,7 @@ import org.apache.poi.sl.usermodel.Sheet
 import org.apache.poi.util.Beta;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.Internal;
+import org.apache.poi.util.Removal;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
 import org.openxmlformats.schemas.presentationml.x2006.main.CTCommonSlideData;
@@ -128,11 +129,19 @@ implements XSLFShapeContainer, Sheet<XSL
      */
     public abstract XmlObject getXmlObject();
 
+    /*
+     * @deprecated POI 3.16 beta 1. use {@link XSLFTable} instead
+     */
+    @Removal(version="3.18")
     @Internal
     public XSLFCommonSlideData getCommonSlideData() {
        return _commonSlideData;
     }
 
+    /*
+     * @deprecated POI 3.16 beta 1. use {@link XSLFTable} instead
+     */
+    @Removal(version="3.18")
     protected void setCommonSlideData(CTCommonSlideData data) {
        if(data == null) {
           _commonSlideData = null;
@@ -550,7 +559,6 @@ implements XSLFShapeContainer, Sheet<XSL
      * @param packagePart   package part containing the data to import
      * @return ID of the created relationship
      */
-    @SuppressWarnings("resource")
     String importBlip(String blipId, PackagePart packagePart) {
         PackageRelationship blipRel = packagePart.getRelationship(blipId);
         PackagePart blipPart;
@@ -573,7 +581,6 @@ implements XSLFShapeContainer, Sheet<XSL
     /**
      * Import a package part into this sheet.
      */
-    @SuppressWarnings("resource")
     PackagePart importPart(PackageRelationship srcRel, PackagePart srcPafrt) {
         PackagePart destPP = getPackagePart();
         PackagePartName srcPPName = srcPafrt.getPartName();

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java?rev=1766746&r1=1766745&r2=1766746&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java Wed Oct 26 22:32:46
2016
@@ -51,6 +51,7 @@ import org.apache.poi.sl.usermodel.Pictu
 import org.apache.poi.sl.usermodel.PictureData.PictureType;
 import org.apache.poi.sl.usermodel.ShapeType;
 import org.apache.poi.sl.usermodel.VerticalAlignment;
+import org.apache.poi.xslf.extractor.XSLFPowerPointExtractor;
 import org.apache.poi.xslf.usermodel.DrawingParagraph;
 import org.apache.poi.xslf.usermodel.DrawingTextBody;
 import org.apache.poi.xslf.usermodel.XMLSlideShow;
@@ -252,14 +253,7 @@ public class TestXSLFBugs {
     }
     
     protected String getSlideText(XSLFSlide slide) {
-        StringBuffer text = new StringBuffer();
-        for(DrawingTextBody textBody : slide.getCommonSlideData().getDrawingText()) {
-            for (DrawingParagraph p : textBody.getParagraphs()) {
-                text.append(p.getText());
-                text.append("\n");
-            }
-        }
-        return text.toString();
+        return XSLFPowerPointExtractor.getText(slide, true, false, false);
     }
 
     @Test

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java?rev=1766746&r1=1766745&r2=1766746&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java
(original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java
Wed Oct 26 22:32:46 2016
@@ -97,21 +97,21 @@ public class TestXSLFPowerPointExtractor
 
 		// Just notes, no slides
 		text = extractor.getText(false, true);
-		assertEquals("\n\n\n\n", text);
+		assertEquals("\n\n1\n\n\n2\n", text);
 
 		// Both
 		text = extractor.getText(true, true, false);
 		String bothText =
 	        "Lorem ipsum dolor sit amet\n" +
             "Nunc at risus vel erat tempus posuere. Aenean non ante.\n" +
-            "\n\n\n" +
+            "\n\n\n1\n" +
             "Lorem ipsum dolor sit amet\n" +
             "Lorem\n" +
             "ipsum\n" +
             "dolor\n" +
             "sit\n" +
             "amet\n" +
-            "\n\n\n";
+            "\n\n\n2\n";
         assertEquals(bothText, text);
 
 		// With Slides and Master Text
@@ -134,22 +134,21 @@ public class TestXSLFPowerPointExtractor
         String snmText =
             "Lorem ipsum dolor sit amet\n" +
             "Nunc at risus vel erat tempus posuere. Aenean non ante.\n" +
-            "\n" +
-            "\n\n" +
+            "\n\n\n1\n" +
             "Lorem ipsum dolor sit amet\n" +
             "Lorem\n" +
             "ipsum\n" +
             "dolor\n" +
             "sit\n" +
             "amet\n" +
-            "\n\n\n";
+            "\n\n\n2\n";
         assertEquals(snmText, text);
 
 		// Via set defaults
 		extractor.setSlidesByDefault(false);
 		extractor.setNotesByDefault(true);
 		text = extractor.getText();
-		assertEquals("\n\n\n\n", text);
+		assertEquals("\n\n1\n\n\n2\n", text);
 
 		extractor.close();
 		xmlA.close();



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


Mime
View raw message