Kaynağa Gözat

Revert "Set default cell type to CellTypeGeneral"

This reverts commit d7440c08e746e5183b44ca398c03ae99e1203f75.
blackss2 10 yıl önce
ebeveyn
işleme
b349260796
2 değiştirilmiş dosya ile 1 ekleme ve 5 silme
  1. 1 1
      cell.go
  2. 0 4
      sheet_test.go

+ 1 - 1
cell.go

@@ -46,7 +46,7 @@ type CellInterface interface {
 
 
 // NewCell creates a cell and adds it to a row.
 // NewCell creates a cell and adds it to a row.
 func NewCell(r *Row) *Cell {
 func NewCell(r *Row) *Cell {
-	return &Cell{Row: r, cellType: CellTypeGeneral}
+	return &Cell{Row: r}
 }
 }
 
 
 // Merge with other cells, horizontally and/or vertically.
 // Merge with other cells, horizontally and/or vertically.

+ 0 - 4
sheet_test.go

@@ -26,7 +26,6 @@ func (s *SheetSuite) TestMakeXLSXSheetFromRows(c *C) {
 	sheet := file.AddSheet("Sheet1")
 	sheet := file.AddSheet("Sheet1")
 	row := sheet.AddRow()
 	row := sheet.AddRow()
 	cell := row.AddCell()
 	cell := row.AddCell()
-	cell.cellType = CellTypeString
 	cell.Value = "A cell!"
 	cell.Value = "A cell!"
 	refTable := NewSharedStringRefTable()
 	refTable := NewSharedStringRefTable()
 	styles := newXlsxStyleSheet(nil)
 	styles := newXlsxStyleSheet(nil)
@@ -192,7 +191,6 @@ func (s *SheetSuite) TestMarshalSheet(c *C) {
 	row := sheet.AddRow()
 	row := sheet.AddRow()
 	cell := row.AddCell()
 	cell := row.AddCell()
 	cell.Value = "A cell!"
 	cell.Value = "A cell!"
-	cell.cellType = CellTypeString
 	refTable := NewSharedStringRefTable()
 	refTable := NewSharedStringRefTable()
 	styles := newXlsxStyleSheet(nil)
 	styles := newXlsxStyleSheet(nil)
 	xSheet := sheet.makeXLSXSheet(refTable, styles)
 	xSheet := sheet.makeXLSXSheet(refTable, styles)
@@ -213,10 +211,8 @@ func (s *SheetSuite) TestMarshalSheetWithMultipleCells(c *C) {
 	sheet := file.AddSheet("Sheet1")
 	sheet := file.AddSheet("Sheet1")
 	row := sheet.AddRow()
 	row := sheet.AddRow()
 	cell := row.AddCell()
 	cell := row.AddCell()
-	cell.cellType = CellTypeString
 	cell.Value = "A cell (with value 1)!"
 	cell.Value = "A cell (with value 1)!"
 	cell = row.AddCell()
 	cell = row.AddCell()
-	cell.cellType = CellTypeString
 	cell.Value = "A cell (with value 2)!"
 	cell.Value = "A cell (with value 2)!"
 	refTable := NewSharedStringRefTable()
 	refTable := NewSharedStringRefTable()
 	styles := newXlsxStyleSheet(nil)
 	styles := newXlsxStyleSheet(nil)