From f0cb29cf6668ab96992b1e48278d9f5b1f9e4976 Mon Sep 17 00:00:00 2001 From: xuri Date: Sat, 5 Mar 2022 14:48:34 +0800 Subject: This closes #1162, improve the compatibility with alternate content Preserve alternate content in the workbook, worksheet, and drawingML --- sheet.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sheet.go') diff --git a/sheet.go b/sheet.go index b440fb9..78fcaf2 100644 --- a/sheet.go +++ b/sheet.go @@ -158,6 +158,13 @@ func (f *File) workSheetWriter() { if sheet.SheetPr != nil || sheet.Drawing != nil || sheet.Hyperlinks != nil || sheet.Picture != nil || sheet.TableParts != nil { f.addNameSpaces(p.(string), SourceRelationship) } + if sheet.DecodeAlternateContent != nil { + sheet.AlternateContent = &xlsxAlternateContent{ + Content: sheet.DecodeAlternateContent.Content, + XMLNSMC: SourceRelationshipCompatibility.Value, + } + } + sheet.DecodeAlternateContent = nil // reusing buffer _ = encoder.Encode(sheet) f.saveFileList(p.(string), replaceRelationshipsBytes(f.replaceNameSpaceBytes(p.(string), buffer.Bytes()))) -- cgit v1.2.1