|
|
@@ -271,7 +271,7 @@ func (sb *StreamFileBuilder) marshalStyles() (string, error) {
|
|
|
//}
|
|
|
|
|
|
// AddStreamStyle adds a new style to the style sheet.
|
|
|
-// Only Styles that have been added through this function will be usable.
|
|
|
+// Only Styles that have been added through either this function or AddStreamStyleList will be usable.
|
|
|
// This function cannot be used after AddSheetWithStyle has been called, and if it is
|
|
|
// called after AddSheetWithStyle it will return an error.
|
|
|
func (sb *StreamFileBuilder) AddStreamStyle(streamStyle StreamStyle) error {
|
|
|
@@ -287,6 +287,20 @@ func (sb *StreamFileBuilder) AddStreamStyle(streamStyle StreamStyle) error {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
+// AddStreamStyleList adds a list of new styles to the style sheet.
|
|
|
+// Only Styles that have been added through either this function or AddStreamStyle will be usable.
|
|
|
+// This function cannot be used after AddSheetWithStyle has been called, and if it is
|
|
|
+// called after AddSheetWithStyle it will return an error.
|
|
|
+func (sb *StreamFileBuilder) AddStreamStyleList(streamStyles []StreamStyle) error {
|
|
|
+ for _, streamStyle := range streamStyles {
|
|
|
+ err := sb.AddStreamStyle(streamStyle)
|
|
|
+ if err != nil{
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
// processEmptySheetXML will take in the path and XML data of an empty sheet, and will save the beginning and end of the
|
|
|
// XML file so that these can be written at the right time.
|
|
|
func (sb *StreamFileBuilder) processEmptySheetXML(sf *StreamFile, path, data string) error {
|