View | Details | Raw Unified | Return to bug 46302
Collapse All | Expand All

(-)src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java (+1 lines)
Lines 1003-1008 Link Here
1003
    public void cloneStyleFrom(CellStyle source) {
1003
    public void cloneStyleFrom(CellStyle source) {
1004
		if(source instanceof HSSFCellStyle) {
1004
		if(source instanceof HSSFCellStyle) {
1005
			this.cloneStyleFrom((HSSFCellStyle)source);
1005
			this.cloneStyleFrom((HSSFCellStyle)source);
1006
            return;
1006
		}
1007
		}
1007
		throw new IllegalArgumentException("Can only clone from one HSSFCellStyle to another, not between HSSFCellStyle and XSSFCellStyle");
1008
		throw new IllegalArgumentException("Can only clone from one HSSFCellStyle to another, not between HSSFCellStyle and XSSFCellStyle");
1008
	}
1009
	}
(-)src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java (-1 / +6 lines)
Lines 111-120 Link Here
111
     */
111
     */
112
    public void cloneStyleFrom(CellStyle source) {
112
    public void cloneStyleFrom(CellStyle source) {
113
        if(source instanceof XSSFCellStyle) {
113
        if(source instanceof XSSFCellStyle) {
114
            this.cloneStyleFrom(source);
114
            this.cloneStyleFrom((XSSFCellStyle)source);
115
            return;
115
        }
116
        }
116
        throw new IllegalArgumentException("Can only clone from one XSSFCellStyle to another, not between HSSFCellStyle and XSSFCellStyle");
117
        throw new IllegalArgumentException("Can only clone from one XSSFCellStyle to another, not between HSSFCellStyle and XSSFCellStyle");
117
    }
118
    }
119
   
120
    public void cloneStyleFrom(XSSFCellStyle source) {
121
        this.cellXf = (CTXf)source.getCoreXf().copy();
122
    }
118
123
119
    /**
124
    /**
120
     * Get the type of horizontal alignment for the cell
125
     * Get the type of horizontal alignment for the cell

Return to bug 46302