summaryrefslogtreecommitdiff
path: root/lib.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-10-28 00:31:55 +0800
committerxuri <xuri.me@gmail.com>2022-10-28 00:31:55 +0800
commita410b22bdd50e9f212b0b454e5aed798e3476394 (patch)
treed8b234f1171f4c0222d09182dc9ed8e7e3ace658 /lib.go
parentadf9d37d82edd3dbc365fece76a031a92e2220d6 (diff)
Fix the error on getting the range of merged cells on the worksheet which contains one cell merged cell range
- Parse workbook default theme for custom theme color support in the feature - Variables name typo fix - Add system foreground and background color as RGB in the IndexedColorMapping list
Diffstat (limited to 'lib.go')
-rw-r--r--lib.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib.go b/lib.go
index 685571c..16170a7 100644
--- a/lib.go
+++ b/lib.go
@@ -626,12 +626,12 @@ func getXMLNamespace(space string, attr []xml.Attr) string {
// replaceNameSpaceBytes provides a function to replace the XML root element
// attribute by the given component part path and XML content.
func (f *File) replaceNameSpaceBytes(path string, contentMarshal []byte) []byte {
- oldXmlns := []byte(`xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">`)
- newXmlns := []byte(templateNamespaceIDMap)
+ sourceXmlns := []byte(`xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">`)
+ targetXmlns := []byte(templateNamespaceIDMap)
if attr, ok := f.xmlAttr[path]; ok {
- newXmlns = []byte(genXMLNamespace(attr))
+ targetXmlns = []byte(genXMLNamespace(attr))
}
- return bytesReplace(contentMarshal, oldXmlns, bytes.ReplaceAll(newXmlns, []byte(" mc:Ignorable=\"r\""), []byte{}), -1)
+ return bytesReplace(contentMarshal, sourceXmlns, bytes.ReplaceAll(targetXmlns, []byte(" mc:Ignorable=\"r\""), []byte{}), -1)
}
// addNameSpaces provides a function to add an XML attribute by the given