Browse Source

Split cell.go into cell.go and style.go

Geoffrey J. Teale 11 years ago
parent
commit
c30d4a91c8
4 changed files with 70 additions and 64 deletions
  1. 0 44
      cell.go
  2. 0 20
      cell_test.go
  3. 45 0
      style.go
  4. 25 0
      style_test.go

+ 0 - 44
cell.go

@@ -7,50 +7,6 @@ import (
 	"strings"
 )
 
-// Style is a high level structure intended to provide user access to
-// the contents of Style within an XLSX file.
-type Style struct {
-	Border Border
-	Fill   Fill
-	Font   Font
-}
-
-func NewStyle() *Style {
-	return &Style{}
-}
-
-// Border is a high level structure intended to provide user access to
-// the contents of Border Style within an Sheet.
-type Border struct {
-	Left   string
-	Right  string
-	Top    string
-	Bottom string
-}
-
-// Fill is a high level structure intended to provide user access to
-// the contents of background and foreground color index within an Sheet.
-type Fill struct {
-	PatternType string
-	BgColor     string
-	FgColor     string
-}
-
-func NewFill(patternType, fgColor, bgColor string) *Fill {
-	return &Fill{PatternType: patternType, FgColor: fgColor, BgColor: bgColor}
-}
-
-type Font struct {
-	Size    int
-	Name    string
-	Family  int
-	Charset int
-}
-
-func NewFont(size int, name string) *Font {
-	return &Font{Size: size, Name: name}
-}
-
 // Cell is a high level structure intended to provide user access to
 // the contents of Cell within an xlsx.Row.
 type Cell struct {

+ 0 - 20
cell_test.go

@@ -4,26 +4,6 @@ import (
 	. "gopkg.in/check.v1"
 )
 
-type StyleSuite struct{}
-
-var _ = Suite(&StyleSuite{})
-
-func (s *StyleSuite) TestNewStyle(c *C) {
-	style := NewStyle()
-	c.Assert(style, NotNil)
-}
-
-type FontSuite struct{}
-
-var _ = Suite(&FontSuite{})
-
-func (s *FontSuite) TestNewFont(c *C) {
-	font := NewFont(12, "Verdana")
-	c.Assert(font, NotNil)
-	c.Assert(font.Name, Equals, "Verdana")
-	c.Assert(font.Size, Equals, 12)
-}
-
 type CellSuite struct{}
 
 var _ = Suite(&CellSuite{})

+ 45 - 0
style.go

@@ -0,0 +1,45 @@
+package xlsx
+
+// Style is a high level structure intended to provide user access to
+// the contents of Style within an XLSX file.
+type Style struct {
+	Border Border
+	Fill   Fill
+	Font   Font
+}
+
+func NewStyle() *Style {
+	return &Style{}
+}
+
+// Border is a high level structure intended to provide user access to
+// the contents of Border Style within an Sheet.
+type Border struct {
+	Left   string
+	Right  string
+	Top    string
+	Bottom string
+}
+
+// Fill is a high level structure intended to provide user access to
+// the contents of background and foreground color index within an Sheet.
+type Fill struct {
+	PatternType string
+	BgColor     string
+	FgColor     string
+}
+
+func NewFill(patternType, fgColor, bgColor string) *Fill {
+	return &Fill{PatternType: patternType, FgColor: fgColor, BgColor: bgColor}
+}
+
+type Font struct {
+	Size    int
+	Name    string
+	Family  int
+	Charset int
+}
+
+func NewFont(size int, name string) *Font {
+	return &Font{Size: size, Name: name}
+}

+ 25 - 0
style_test.go

@@ -0,0 +1,25 @@
+package xlsx
+
+import (
+	. "gopkg.in/check.v1"
+)
+
+type StyleSuite struct{}
+
+var _ = Suite(&StyleSuite{})
+
+func (s *StyleSuite) TestNewStyle(c *C) {
+	style := NewStyle()
+	c.Assert(style, NotNil)
+}
+
+type FontSuite struct{}
+
+var _ = Suite(&FontSuite{})
+
+func (s *FontSuite) TestNewFont(c *C) {
+	font := NewFont(12, "Verdana")
+	c.Assert(font, NotNil)
+	c.Assert(font.Name, Equals, "Verdana")
+	c.Assert(font.Size, Equals, 12)
+}