Minor bug fix to previous check-in: made sure blank cells in the 2 newly generated columns don't get filled in.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@2368 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2011-11-07 19:53:26 +00:00
parent d01745284b
commit dbeaefb00b

View File

@ -339,12 +339,17 @@ public class TransposeColumnsIntoRowsOperation extends AbstractOperation {
for (int r2 = firstNewRowIndex + 1; r2 < newRows.size(); r2++) { for (int r2 = firstNewRowIndex + 1; r2 < newRows.size(); r2++) {
Row newRow = newRows.get(r2); Row newRow = newRows.get(r2);
for (int c = 0; c < newColumns.size(); c++) { for (int c = 0; c < newColumns.size(); c++) {
Column column = newColumns.get(c); if (c < startColumnIndex ||
int cellIndex = column.getCellIndex(); (_combinedColumnName != null ?
c > startColumnIndex :
Cell cellToCopy = firstNewRow.getCell(cellIndex); c > startColumnIndex + 1)) {
if (cellToCopy != null && newRow.getCell(cellIndex) == null) { Column column = newColumns.get(c);
newRow.setCell(cellIndex, cellToCopy); int cellIndex = column.getCellIndex();
Cell cellToCopy = firstNewRow.getCell(cellIndex);
if (cellToCopy != null && newRow.getCell(cellIndex) == null) {
newRow.setCell(cellIndex, cellToCopy);
}
} }
} }
} }