浏览代码

- Fix `completeCol()` make extra rows, relate issue #87;
- godoc updated

Ri Xu 8 年之前
父节点
当前提交
961996a813
共有 2 个文件被更改,包括 7 次插入9 次删除
  1. 0 7
      col.go
  2. 7 2
      styles.go

+ 0 - 7
col.go

@@ -277,13 +277,6 @@ func (f *File) RemoveCol(sheet, column string) {
 
 // Completion column element tags of XML in a sheet.
 func completeCol(xlsx *xlsxWorksheet, row, cell int) {
-	if len(xlsx.SheetData.Row) < cell {
-		for i := len(xlsx.SheetData.Row); i < cell; i++ {
-			xlsx.SheetData.Row = append(xlsx.SheetData.Row, xlsxRow{
-				R: i + 1,
-			})
-		}
-	}
 	buffer := bytes.Buffer{}
 	for k, v := range xlsx.SheetData.Row {
 		if len(v.C) < cell {

+ 7 - 2
styles.go

@@ -1796,9 +1796,14 @@ func parseFormatStyleSet(style string) (*formatCellStyle, error) {
 //     634   | ZWR
 //
 // Excelize support set custom number format for cell. For example, set number
-// as date type in Uruguay (Spanish) format:
+// as date type in Uruguay (Spanish) format for Sheet1!A6:
 //
-//    xlsx.NewStyle(`{"custom_number_format": "[$-380A]dddd\\,\\ dd\" de \"mmmm\" de \"yyyy;@"}`)
+//    xlsx := excelize.NewFile()
+//    xlsx.SetCellValue("Sheet1", "A6", 42920.5)
+//    style, _ := xlsx.NewStyle(`{"custom_number_format": "[$-380A]dddd\\,\\ dd\" de \"mmmm\" de \"yyyy;@"}`)
+//    xlsx.SetCellStyle("Sheet1", "A6", "A6", style)
+//
+// Cell Sheet1!A6 in the Excel Application: martes, 04 de Julio de 2017
 //
 func (f *File) NewStyle(style string) (int, error) {
 	var cellXfsID int