poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fannin...@apache.org
Subject svn commit: r1802131 - in /poi/trunk/src/ooxml: java/org/apache/poi/xssf/usermodel/ java/org/apache/poi/xssf/util/ testcases/org/apache/poi/xssf/usermodel/ testcases/org/apache/poi/xssf/util/
Date Mon, 17 Jul 2017 11:36:32 GMT
Author: fanningpj
Date: Mon Jul 17 11:36:32 2017
New Revision: 1802131

URL: http://svn.apache.org/viewvc?rev=1802131&view=rev
Log:
fix tests broken by <br/> doc changes

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/util/TestEvilUnclosedBRFixingInputStream.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java?rev=1802131&r1=1802130&r2=1802131&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java Mon Jul 17
11:36:32 2017
@@ -120,7 +120,6 @@ public final class XSSFVMLDrawing extend
         read(getPackagePart().getInputStream());
     }
 
-    @SuppressWarnings("resource")
     protected void read(InputStream is) throws IOException, XmlException {
         Document doc;
         try {
@@ -130,7 +129,7 @@ public final class XSSFVMLDrawing extend
              * The result is that they contain things like &gt;br&lt;, which breaks
the XML parsing.
              * This very sick InputStream wrapper attempts to spot these go past, and fix
them.
              */
-            doc = DocumentHelper.readDocument(new ReplacingInputStream(is, "<br>",
"<br>"));
+            doc = DocumentHelper.readDocument(new ReplacingInputStream(is, "<br>",
"<br/>"));
         } catch (SAXException e) {
             throw new XmlException(e.getMessage(), e);
         }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java?rev=1802131&r1=1802130&r2=1802131&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java
Mon Jul 17 11:36:32 2017
@@ -41,6 +41,6 @@ import org.apache.poi.util.ReplacingInpu
 @Internal
 public class EvilUnclosedBRFixingInputStream extends ReplacingInputStream {
    public EvilUnclosedBRFixingInputStream(InputStream source) {
-      super(source, "<br>", "<br>");
+      super(source, "<br>", "<br/>");
    }
 }

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java?rev=1802131&r1=1802130&r2=1802131&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java Mon Jul
17 11:36:32 2017
@@ -226,7 +226,7 @@ public final class TestXSSFBugs extends
      * Excel will sometimes write a button with a textbox
      * containing &gt;br&lt; (not closed!).
      * Clearly Excel shouldn't do this, but test that we can
-     * read the file despite the naughtyness
+     * read the file despite the naughtiness
      */
     @Test
     public void bug49020() throws IOException {

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java?rev=1802131&r1=1802130&r2=1802131&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java Mon
Jul 17 11:36:32 2017
@@ -174,7 +174,7 @@ public class TestXSSFVMLDrawing {
         } finally {
             stream.close();
         }
-        Pattern p = Pattern.compile("<br>");
+        Pattern p = Pattern.compile("<br/>");
         int count = 0;
         for (XmlObject xo : vml.getItems()) {
             String split[] = p.split(xo.toString());

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/util/TestEvilUnclosedBRFixingInputStream.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/util/TestEvilUnclosedBRFixingInputStream.java?rev=1802131&r1=1802130&r2=1802131&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/util/TestEvilUnclosedBRFixingInputStream.java
(original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/util/TestEvilUnclosedBRFixingInputStream.java
Mon Jul 17 11:36:32 2017
@@ -32,7 +32,7 @@ public final class TestEvilUnclosedBRFix
 
     static class EvilUnclosedBRFixingInputStream extends ReplacingInputStream {
         public EvilUnclosedBRFixingInputStream(byte[] source) {
-            super(new ByteArrayInputStream(source), "<br>", "<br>");
+            super(new ByteArrayInputStream(source), "<br>", "<br/>");
         }
     }
 
@@ -49,7 +49,7 @@ public final class TestEvilUnclosedBRFix
     @Test
     public void testProblem() throws IOException {
         byte[] orig = getBytes("<p><div>Hello<br>There!</div> <div>Tags!</div></p>");
-        byte[] fixed = getBytes("<p><div>Hello<br>There!</div> <div>Tags!</div></p>");
+        byte[] fixed = getBytes("<p><div>Hello<br/>There!</div> <div>Tags!</div></p>");
 
         EvilUnclosedBRFixingInputStream inp = new EvilUnclosedBRFixingInputStream(orig);
 
@@ -63,7 +63,7 @@ public final class TestEvilUnclosedBRFix
     @Test
     public void testBufferSize() throws IOException {
         byte[] orig = getBytes("<p><div>Hello<br> <br>There!</div>
<div>Tags!<br><br></div></p>");
-        byte[] fixed = getBytes("<p><div>Hello<br> <br>There!</div>
<div>Tags!<br><br></div></p>");
+        byte[] fixed = getBytes("<p><div>Hello<br/> <br/>There!</div>
<div>Tags!<br/><br/></div></p>");
 
         // Vary the buffer size, so that we can end up with the br in the
         //  overflow or only part in the buffer



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


Mime
View raw message