mirror of https://github.com/apache/poi.git
remove some unnecessary casts from copy method
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1891763 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
50a4a3102f
commit
49237e4e98
|
@ -34,6 +34,7 @@ import org.apache.poi.ss.usermodel.FormulaError;
|
||||||
import org.apache.poi.ss.usermodel.Row;
|
import org.apache.poi.ss.usermodel.Row;
|
||||||
import org.apache.poi.ss.usermodel.helpers.RowShifter;
|
import org.apache.poi.ss.usermodel.helpers.RowShifter;
|
||||||
import org.apache.poi.ss.util.CellRangeAddress;
|
import org.apache.poi.ss.util.CellRangeAddress;
|
||||||
|
import org.apache.poi.ss.util.CellUtil;
|
||||||
import org.apache.poi.util.Beta;
|
import org.apache.poi.util.Beta;
|
||||||
import org.apache.poi.util.Internal;
|
import org.apache.poi.util.Internal;
|
||||||
import org.apache.poi.xssf.model.StylesTable;
|
import org.apache.poi.xssf.model.StylesTable;
|
||||||
|
@ -650,8 +651,7 @@ public class XSSFRow implements Row, Comparable<XSSFRow> {
|
||||||
// srcRow is blank. Overwrite cells with blank values, blank styles, etc per cell copy policy
|
// srcRow is blank. Overwrite cells with blank values, blank styles, etc per cell copy policy
|
||||||
for (Cell destCell : this) {
|
for (Cell destCell : this) {
|
||||||
final XSSFCell srcCell = null;
|
final XSSFCell srcCell = null;
|
||||||
// FIXME: remove type casting when copyCellFrom(Cell, CellCopyPolicy) is added to Cell interface
|
CellUtil.copyCell(srcCell, destCell, policy);
|
||||||
((XSSFCell)destCell).copyCellFrom(srcCell, policy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (policy.isCopyMergedRegions()) {
|
if (policy.isCopyMergedRegions()) {
|
||||||
|
@ -675,10 +675,9 @@ public class XSSFRow implements Row, Comparable<XSSFRow> {
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (final Cell c : srcRow){
|
for (final Cell c : srcRow) {
|
||||||
final XSSFCell srcCell = (XSSFCell)c;
|
final XSSFCell destCell = createCell(c.getColumnIndex());
|
||||||
final XSSFCell destCell = createCell(srcCell.getColumnIndex());
|
destCell.copyCellFrom(c, policy);
|
||||||
destCell.copyCellFrom(srcCell, policy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final int sheetIndex = _sheet.getWorkbook().getSheetIndex(_sheet);
|
final int sheetIndex = _sheet.getWorkbook().getSheetIndex(_sheet);
|
||||||
|
|
Loading…
Reference in New Issue