Change XSSFSheetXMLHandler.SheetContentsHandler to require fewer backwards incompatible changes for #56023

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1614576 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2014-07-30 07:41:01 +00:00
parent c9e6a7345c
commit f0dc1291ad
2 changed files with 8 additions and 8 deletions

View File

@ -466,7 +466,7 @@ public class XSSFSheetXMLHandler extends DefaultHandler {
private void outputEmptyCellComment(CellReference cellRef) {
String cellRefString = cellRef.formatAsString();
XSSFComment comment = commentsTable.findCellComment(cellRefString);
output.emptyCellComment(cellRefString, comment);
output.cell(cellRefString, null, comment);
}
private enum EmptyCellCommentsCheckType {
@ -497,10 +497,10 @@ public class XSSFSheetXMLHandler extends DefaultHandler {
public void startRow(int rowNum);
/** A row with the (zero based) row number has ended */
public void endRow(int rowNum);
/** A cell, with the given formatted value, and possibly a comment, was encountered */
/**
* A cell, with the given formatted value (may be null),
* and possibly a comment (may be null), was encountered */
public void cell(String cellReference, String formattedValue, XSSFComment comment);
/** A comment for an otherwise-empty cell was encountered */
public void emptyCellComment(String cellReference, XSSFComment comment);
/** A header or footer has been encountered */
public void headerFooter(String text, boolean isHeader, String tagName);
}

View File

@ -268,14 +268,17 @@ public class XSSFEventBasedExcelExtractor extends POIXMLTextExtractor
this.headerFooterMap = includeHeadersFooters ? new HashMap<String, String>() : null;
}
@Override
public void startRow(int rowNum) {
firstCellOfRow = true;
}
@Override
public void endRow(int rowNum) {
output.append('\n');
}
@Override
public void cell(String cellRef, String formattedValue, XSSFComment comment) {
if(firstCellOfRow) {
firstCellOfRow = false;
@ -296,10 +299,7 @@ public class XSSFEventBasedExcelExtractor extends POIXMLTextExtractor
}
}
public void emptyCellComment(String cellRef, XSSFComment comment) {
cell(cellRef, null, comment);
}
@Override
public void headerFooter(String text, boolean isHeader, String tagName) {
if (headerFooterMap != null) {
headerFooterMap.put(tagName, text);