Просмотр исходного кода

Removed the IsCustom bool for row height

Colin Fox 10 лет назад
Родитель
Сommit
dca341213e
2 измененных файлов с 5 добавлено и 7 удалено
  1. 4 6
      row.go
  2. 1 1
      sheet.go

+ 4 - 6
row.go

@@ -1,16 +1,14 @@
 package xlsx
 
 type Row struct {
-	Cells    []*Cell
-	Hidden   bool
-	Sheet    *Sheet
-	Height   float64
-	IsCustom bool
+	Cells  []*Cell
+	Hidden bool
+	Sheet  *Sheet
+	Height float64
 }
 
 func (r *Row) SetHeightCM(ht float64) {
 	r.Height = ht * 28.3464567 // Convert CM to postscript points
-	r.IsCustom = true
 }
 
 func (r *Row) AddCell() *Cell {

+ 1 - 1
sheet.go

@@ -110,7 +110,7 @@ func (s *Sheet) makeXLSXSheet(refTable *RefTable, styles *xlsxStyleSheet) *xlsxW
 		}
 		xRow := xlsxRow{}
 		xRow.R = r + 1
-		if row.IsCustom {
+		if row.Height > 0 {
 			xRow.CustomHeight = true
 			xRow.Ht = fmt.Sprintf("%g", row.Height)
 		}