Copy/paste a range doesn't copy column width and row height to destination range

XMLWordPrintable

    • Type: Bug
    • Resolution: Invalid
    • Priority: Normal
    • None
    • Affects Version/s: 3.8.3
    • Component/s: None
    • Security Level: Jimmy
    • None
    • Sprint 6

      steps to reproduce

      1. run the attached program, it pastes a range with srcRange.paste(destRange); to another sheet

      actual result

      the custom column width and row height is not applied to the destination sheet.

      workaround

      	static void applyRowHeight(Range source, Range destination) {
      		for (int row = source.getRow() ; row <= source.getLastRow() ; row++){
      			int height = source.getSheet().getRowHeight(row);
      			CellOperationUtil.setRowHeight(destination.toCellRange(row-source.getRow(), 0), height);
      		}
      	}
      
      	static void applyColumnWidth(Range source, Range destination) {
      		for (int c = source.getColumn() ; c <= source.getLastColumn() ; c++){
      			int widthPx = source.getSheet().getColumnWidth(c);
      			CellOperationUtil.setColumnWidth(destination.toCellRange(0, c-source.getColumn()), widthPx);
      		}
      	}
      

            Assignee:
            Unassigned
            Reporter:
            hawk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: