Browse Source

Test empty styleSheet output from xlsxStyleSheet.Marshal()

Geoffrey J. Teale 11 years ago
parent
commit
146a0bed66
2 changed files with 9 additions and 1 deletions
  1. 1 1
      file.go
  2. 8 0
      xmlStyle.go

+ 1 - 1
file.go

@@ -214,7 +214,7 @@ func (f *File) MarshallParts() (map[string]string, error) {
 		return parts, err
 	}
 
-	parts["xl/styles.xml"], err = marshal(styles)
+	parts["xl/styles.xml"], err = styles.Marshal()
 	if err != nil {
 		return parts, err
 	}

+ 8 - 0
xmlStyle.go

@@ -279,3 +279,11 @@ func (styles *xlsxStyleSheet) addCellXf(xCellXf xlsxXf) (index int) {
 	styles.CellXfs.Count += 1
 	return
 }
+
+func (styles *xlsxStyleSheet) Marshal() (result string, err error) {
+	result = xml.Header
+	result += `<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
+`
+	result += `</styleSheet>`
+	return
+}