2011-12-21 20 views

回答

1

嗯,這裏的源代碼setCellStyle()

public void setCellStyle(CellStyle style) { 
    if(style == null) { 
     if(_cell.isSetS()) _cell.unsetS(); 
    } else { 
     XSSFCellStyle xStyle = (XSSFCellStyle)style; 
     xStyle.verifyBelongsToStylesSource(_stylesSource); 

     long idx = _stylesSource.putStyle(xStyle); 
     _cell.setS(idx); 
    } 
} 

_cellorg.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell型的,我無法在網上找到的源代碼。但是,由於_cell.setS(idx)的調用僅傳入索引,因此API看起來不夠豐富,無法支持樣式合併。我強烈懷疑你的第二種風格具有你所看到的所有屬性。

相關問題