diff options
author | xuri <xuri.me@gmail.com> | 2022-03-05 14:48:34 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-03-05 14:48:34 +0800 |
commit | f0cb29cf6668ab96992b1e48278d9f5b1f9e4976 (patch) | |
tree | 3bcc69e973d070edf0d3a0f7764bb7e91d7774ca /workbook.go | |
parent | 129052ae7db0fd2c59b1ea9158df0e75450cad42 (diff) |
This closes #1162, improve the compatibility with alternate content
Preserve alternate content in the workbook, worksheet, and drawingML
Diffstat (limited to 'workbook.go')
-rw-r--r-- | workbook.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/workbook.go b/workbook.go index 3d9fa48..c65397b 100644 --- a/workbook.go +++ b/workbook.go @@ -101,6 +101,13 @@ func (f *File) workbookReader() *xlsxWorkbook { // structure. func (f *File) workBookWriter() { if f.WorkBook != nil { + if f.WorkBook.DecodeAlternateContent != nil { + f.WorkBook.AlternateContent = &xlsxAlternateContent{ + Content: f.WorkBook.DecodeAlternateContent.Content, + XMLNSMC: SourceRelationshipCompatibility.Value, + } + } + f.WorkBook.DecodeAlternateContent = nil output, _ := xml.Marshal(f.WorkBook) f.saveFileList(f.getWorkbookPath(), replaceRelationshipsBytes(f.replaceNameSpaceBytes(f.getWorkbookPath(), output))) } |