Sfoglia il codice sorgente

rename internal method

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1879838 13f79535-47bb-0310-9956-ffa450edef68
tags/before_ooxml_3rd_edition
PJ Fanning 3 anni fa
parent
commit
2f2d6c606a

+ 6
- 6
src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java Vedi File

@@ -283,7 +283,7 @@ public class SheetDataWriter implements Closeable {
break;
}
_out.write("><f>");
outputQuotedString(cell.getCellFormula());
outputEscapedString(cell.getCellFormula());
_out.write("</f>");
switch (cell.getCachedFormulaResultType()) {
case NUMERIC:
@@ -298,7 +298,7 @@ public class SheetDataWriter implements Closeable {
String value = cell.getStringCellValue();
if(value != null && !value.isEmpty()) {
_out.write("<v>");
outputQuotedString(value);
outputEscapedString(value);
_out.write("</v>");
}
break;
@@ -311,7 +311,7 @@ public class SheetDataWriter implements Closeable {
FormulaError error = FormulaError.forInt(cell.getErrorCellValue());

_out.write("><v>");
outputQuotedString(error.getString());
outputEscapedString(error.getString());
_out.write("</v>");
break;
}
@@ -334,7 +334,7 @@ public class SheetDataWriter implements Closeable {
writeAttribute("xml:space", "preserve");
}
_out.write(">");
outputQuotedString(cell.getStringCellValue());
outputEscapedString(cell.getStringCellValue());
_out.write("</t></is>");
}
break;
@@ -358,7 +358,7 @@ public class SheetDataWriter implements Closeable {

writeAttribute("t", "e");
_out.write("><v>");
outputQuotedString(error.getString());
outputEscapedString(error.getString());
_out.write("</v>");
break;
}
@@ -390,7 +390,7 @@ public class SheetDataWriter implements Closeable {
return false;
}

protected void outputQuotedString(String s) throws IOException {
protected void outputEscapedString(String s) throws IOException {
if (s == null || s.length() == 0) {
return;
}

+ 2
- 2
src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSheetDataWriter.java Vedi File

@@ -58,7 +58,7 @@ public final class TestSheetDataWriter {
public void testWriteUnicodeSurrogates() throws IOException {
SheetDataWriter writer = new SheetDataWriter();
try {
writer.outputQuotedString(unicodeSurrogates);
writer.outputEscapedString(unicodeSurrogates);
writer.close();
File file = writer.getTempFile();
try (FileInputStream is = new FileInputStream(file)) {
@@ -73,7 +73,7 @@ public final class TestSheetDataWriter {
public void testWriteNewLines() throws IOException {
SheetDataWriter writer = new SheetDataWriter();
try {
writer.outputQuotedString("\r\n");
writer.outputEscapedString("\r\n");
writer.close();
File file = writer.getTempFile();
try (FileInputStream is = new FileInputStream(file)) {

Loading…
Annulla
Salva