From 482e8340c1be6e6f42fa2f1c7281a756224e0a99 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Wed, 30 Jul 2014 07:41:01 +0000 Subject: [PATCH] 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 --- .../poi/xssf/eventusermodel/XSSFSheetXMLHandler.java | 8 ++++---- .../poi/xssf/extractor/XSSFEventBasedExcelExtractor.java | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java index 06c9f09b9a..baaac30406 100644 --- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java +++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java @@ -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); } diff --git a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java index c598ed2e3d..b70c4abb34 100644 --- a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java +++ b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java @@ -268,14 +268,17 @@ public class XSSFEventBasedExcelExtractor extends POIXMLTextExtractor this.headerFooterMap = includeHeadersFooters ? new HashMap() : 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); -- 2.39.5