summaryrefslogtreecommitdiff
path: root/lib.go
diff options
context:
space:
mode:
authorRi Xu <xuri.me@gmail.com>2016-09-05 16:37:15 +0800
committerRi Xu <xuri.me@gmail.com>2016-09-05 16:37:15 +0800
commit50863294f9d6f2ecc399d06f1b3c2312c4bdce10 (patch)
tree0cc7513dd3c56eef889432f27da1186288a2ed98 /lib.go
parent956a4627d1f2b78172eaaf6078209d4cf8e64ce2 (diff)
Fix issue #2 change project to object-oriented style and update readme file.
Diffstat (limited to 'lib.go')
-rw-r--r--lib.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib.go b/lib.go
index 7147424..915bca1 100644
--- a/lib.go
+++ b/lib.go
@@ -30,17 +30,16 @@ func ReadZipReader(r *zip.Reader) (map[string]string, error) {
}
// Read XML content as string and replace drawing property in XML namespace of sheet
-func readXML(files map[string]string, name string) string {
- if content, ok := files[name]; ok {
+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 ``
}
// Update given file content in file list of XLSX
-func saveFileList(files map[string]string, name string, content string) map[string]string {
- files[name] = XMLHeader + content
- return files
+func (f *File) saveFileList(name string, content string) {
+ f.XLSX[name] = XMLHeader + content
}
// Read file content as string in a archive file