diff options
author | Ri Xu <xuri.me@gmail.com> | 2016-12-26 23:55:59 +0800 |
---|---|---|
committer | Ri Xu <xuri.me@gmail.com> | 2016-12-26 23:55:59 +0800 |
commit | f958f05a3bf6f9fdc7f76539d9a3b24f49cc2694 (patch) | |
tree | 42e8555700d078213547c1287b7756cfbc68ed6b /lib.go | |
parent | c5cc500b886366a99641eaa7bc24613f6066fd79 (diff) |
- Fix issue: sheet protection and conditional formatting proprietary missing after save;
- Update workbook and sheet relationships and self-close tag replacement hack functions
Diffstat (limited to 'lib.go')
-rw-r--r-- | lib.go | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -7,7 +7,6 @@ import ( "io" "log" "math" - "strings" ) // ReadZip takes a pointer to a zip.ReadCloser and returns a @@ -28,7 +27,7 @@ func ReadZipReader(r *zip.Reader) (map[string]string, int, error) { if len(v.Name) > 18 { if v.Name[0:19] == `xl/worksheets/sheet` { var xlsx xlsxWorksheet - xml.Unmarshal([]byte(strings.Replace(fileList[v.Name], `<drawing r:id=`, `<drawing rid=`, -1)), &xlsx) + xml.Unmarshal([]byte(fileList[v.Name]), &xlsx) xlsx = checkRow(xlsx) output, _ := xml.Marshal(xlsx) fileList[v.Name] = replaceRelationshipsID(replaceWorkSheetsRelationshipsNameSpace(string(output))) @@ -39,10 +38,10 @@ func ReadZipReader(r *zip.Reader) (map[string]string, int, error) { return fileList, worksheets, nil } -// Read XML content as string and replace drawing property in XML namespace of sheet. +// Read XML content as string. func (f *File) readXML(name string) string { if content, ok := f.XLSX[name]; ok { - return strings.Replace(content, `<drawing r:id=`, `<drawing rid=`, -1) + return content } return `` } |