Skip to content

Commit

Permalink
This closes #1889, refs #1732 and #1735 (#1890)
Browse files Browse the repository at this point in the history
Saving workbook with reverse sorted internal part path to keep same hash of identical files and fix incorrect MIME type
  • Loading branch information
barlevd committed Apr 30, 2024
1 parent 7715c14 commit 781c384
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions file.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (f *File) writeToZip(zw *zip.Writer) error {
files = append(files, path.(string))
return true
})
sort.Strings(files)
sort.Sort(sort.Reverse(sort.StringSlice(files)))
for _, path := range files {
var fi io.Writer
if fi, err = zw.Create(path); err != nil {
Expand All @@ -228,7 +228,7 @@ func (f *File) writeToZip(zw *zip.Writer) error {
tempFiles = append(tempFiles, path.(string))
return true
})
sort.Strings(tempFiles)
sort.Sort(sort.Reverse(sort.StringSlice(tempFiles)))
for _, path := range tempFiles {
var fi io.Writer
if fi, err = zw.Create(path); err != nil {
Expand Down

0 comments on commit 781c384

Please sign in to comment.