Geoffrey Teale 12 rokov pred
rodič
commit
657ab10e32
2 zmenil súbory, kde vykonal 21 pridanie a 23 odobranie
  1. 4 4
      lib.go
  2. 17 19
      lib_test.go

+ 4 - 4
lib.go

@@ -44,7 +44,7 @@ func (c *Cell) GetStyle() *Style {
 	style := &Style{}
 
 	if c.styleIndex > 0 && c.styleIndex <= len(c.styles.CellXfs) {
-		xf := c.styles.CellXfs[c.styleIndex - 1]
+		xf := c.styles.CellXfs[c.styleIndex-1]
 		if xf.ApplyBorder {
 			var border Border
 			border.Left = c.styles.Borders[xf.BorderId].Left.Style
@@ -112,9 +112,9 @@ type Fill struct {
 }
 
 type Font struct {
-	Size int
-	Name string
-	Family int
+	Size    int
+	Name    string
+	Family  int
 	Charset int
 }
 

+ 17 - 19
lib_test.go

@@ -76,7 +76,7 @@ func TestGetStyleWithFonts(t *testing.T) {
 
 	fonts = make([]xlsxFont, 1)
 	fonts[0] = xlsxFont{
-		Sz: xlsxVal{Val: "10"},
+		Sz:   xlsxVal{Val: "10"},
 		Name: xlsxVal{Val: "Calibra"}}
 
 	cellXfs = make([]xlsxXf, 1)
@@ -114,7 +114,6 @@ func TestReadSharedStringsFromZipFile(t *testing.T) {
 	}
 }
 
-
 func testXf(t *testing.T, result, expected *xlsxXf) {
 	if result.ApplyAlignment != expected.ApplyAlignment {
 		t.Error("Expected result.ApplyAlignment == ", expected.ApplyAlignment,
@@ -237,15 +236,15 @@ func TestReadStylesFromZipFile(t *testing.T) {
 	}
 	xf = xlsxFile.styles.CellStyleXfs[0]
 	expectedXf := &xlsxXf{
-		ApplyAlignment: true,
-		ApplyBorder: true,
-		ApplyFont: true,
-		ApplyFill: false,
+		ApplyAlignment:  true,
+		ApplyBorder:     true,
+		ApplyFont:       true,
+		ApplyFill:       false,
 		ApplyProtection: true,
-		BorderId: 0,
-		FillId: 0,
-		FontId: 0,
-		NumFmtId: 164}
+		BorderId:        0,
+		FillId:          0,
+		FontId:          0,
+		NumFmtId:        164}
 	testXf(t, &xf, expectedXf)
 
 	cellXfCount = len(xlsxFile.styles.CellXfs)
@@ -255,15 +254,15 @@ func TestReadStylesFromZipFile(t *testing.T) {
 	}
 	xf = xlsxFile.styles.CellXfs[0]
 	expectedXf = &xlsxXf{
-		ApplyAlignment: false,
-		ApplyBorder: false,
-		ApplyFont: false,
-		ApplyFill: false,
+		ApplyAlignment:  false,
+		ApplyBorder:     false,
+		ApplyFont:       false,
+		ApplyFill:       false,
 		ApplyProtection: false,
-		BorderId: 0,
-		FillId: 0,
-		FontId: 0,
-		NumFmtId: 164}
+		BorderId:        0,
+		FillId:          0,
+		FontId:          0,
+		NumFmtId:        164}
 	testXf(t, &xf, expectedXf)
 }
 
@@ -644,5 +643,4 @@ func TestReadRowsFromSheetWithTrailingEmptyCells(t *testing.T) {
 		t.Error("Expected cell4.String() == '', got ", cell4.String())
 	}
 
-
 }