Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit 8086d9b

Browse files
authored
Merge pull request #785 from sfwn/fix/xmlworksheet-mergecells-datavalidations
fix the issue that cannot emit MergeCells and DataValidations together
2 parents e01f87e + b3d7083 commit 8086d9b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

xmlWorksheet.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,14 +760,18 @@ func (worksheet *xlsxWorksheet) WriteXML(xw *xmlwriter.Writer, s *Sheet, styles
760760
if err != nil {
761761
return err
762762
}
763-
return xw.Write(mergeCells)
763+
if err := xw.Write(mergeCells); err != nil {
764+
return err
765+
}
764766
}
765767
if worksheet.DataValidations != nil {
766768
dataValidation, err := emitStructAsXML(reflect.ValueOf(worksheet.DataValidations), "dataValidations", "")
767769
if err != nil {
768770
return err
769771
}
770-
return xw.Write(dataValidation)
772+
if err := xw.Write(dataValidation); err != nil {
773+
return err
774+
}
771775
}
772776
return nil
773777
}(),

0 commit comments

Comments
 (0)