aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2017-07-17 11:36:32 +0000
committerPJ Fanning <fanningpj@apache.org>2017-07-17 11:36:32 +0000
commitb23a94305498f2da0ffdab8a284f6db6a7fa50c0 (patch)
treec47863ae34458c4cd2dd5101688c6b4b71563351 /src/ooxml
parent52d3ea57f47b580b215c879840f634f2a31aaa43 (diff)
downloadpoi-b23a94305498f2da0ffdab8a284f6db6a7fa50c0.tar.gz
poi-b23a94305498f2da0ffdab8a284f6db6a7fa50c0.zip
fix tests broken by <br/> doc changes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1802131 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml')
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java3
-rw-r--r--src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java2
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java2
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java2
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/util/TestEvilUnclosedBRFixingInputStream.java6
5 files changed, 7 insertions, 8 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java
index b6874a481a..43c38bce5b 100644
--- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java
+++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFVMLDrawing.java
@@ -120,7 +120,6 @@ public final class XSSFVMLDrawing extends POIXMLDocumentPart {
read(getPackagePart().getInputStream());
}
- @SuppressWarnings("resource")
protected void read(InputStream is) throws IOException, XmlException {
Document doc;
try {
@@ -130,7 +129,7 @@ public final class XSSFVMLDrawing extends POIXMLDocumentPart {
* 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);
}
diff --git a/src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java b/src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java
index 65401148e5..0ef1aeeb5e 100644
--- a/src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java
+++ b/src/ooxml/java/org/apache/poi/xssf/util/EvilUnclosedBRFixingInputStream.java
@@ -41,6 +41,6 @@ import org.apache.poi.util.ReplacingInputStream;
@Internal
public class EvilUnclosedBRFixingInputStream extends ReplacingInputStream {
public EvilUnclosedBRFixingInputStream(InputStream source) {
- super(source, "<br>", "<br>");
+ super(source, "<br>", "<br/>");
}
}
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
index cc38582ab9..01e3b92807 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
@@ -226,7 +226,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
* 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 {
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java
index 477f159193..b8dbd36a71 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java
@@ -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());
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/util/TestEvilUnclosedBRFixingInputStream.java b/src/ooxml/testcases/org/apache/poi/xssf/util/TestEvilUnclosedBRFixingInputStream.java
index 654bbb1d42..d9010fbbc2 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/util/TestEvilUnclosedBRFixingInputStream.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/util/TestEvilUnclosedBRFixingInputStream.java
@@ -32,7 +32,7 @@ public final class TestEvilUnclosedBRFixingInputStream {
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 TestEvilUnclosedBRFixingInputStream {
@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 TestEvilUnclosedBRFixingInputStream {
@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