summaryrefslogtreecommitdiff
path: root/lib.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib.go')
-rw-r--r--lib.go21
1 files changed, 8 insertions, 13 deletions
diff --git a/lib.go b/lib.go
index 99118ff..0408139 100644
--- a/lib.go
+++ b/lib.go
@@ -148,8 +148,7 @@ func readFile(file *zip.File) ([]byte, error) {
//
// Example:
//
-// excelize.SplitCellName("AK74") // return "AK", 74, nil
-//
+// excelize.SplitCellName("AK74") // return "AK", 74, nil
func SplitCellName(cell string) (string, int, error) {
alpha := func(r rune) bool {
return ('A' <= r && r <= 'Z') || ('a' <= r && r <= 'z') || (r == 36)
@@ -192,8 +191,7 @@ func JoinCellName(col string, row int) (string, error) {
//
// Example:
//
-// excelize.ColumnNameToNumber("AK") // returns 37, nil
-//
+// excelize.ColumnNameToNumber("AK") // returns 37, nil
func ColumnNameToNumber(name string) (int, error) {
if len(name) == 0 {
return -1, newInvalidColumnNameError(name)
@@ -222,8 +220,7 @@ func ColumnNameToNumber(name string) (int, error) {
//
// Example:
//
-// excelize.ColumnNumberToName(37) // returns "AK", nil
-//
+// excelize.ColumnNumberToName(37) // returns "AK", nil
func ColumnNumberToName(num int) (string, error) {
if num < MinColumns || num > MaxColumns {
return "", ErrColumnNumber
@@ -241,9 +238,8 @@ func ColumnNumberToName(num int) (string, error) {
//
// Example:
//
-// excelize.CellNameToCoordinates("A1") // returns 1, 1, nil
-// excelize.CellNameToCoordinates("Z3") // returns 26, 3, nil
-//
+// excelize.CellNameToCoordinates("A1") // returns 1, 1, nil
+// excelize.CellNameToCoordinates("Z3") // returns 26, 3, nil
func CellNameToCoordinates(cell string) (int, int, error) {
colName, row, err := SplitCellName(cell)
if err != nil {
@@ -261,9 +257,8 @@ func CellNameToCoordinates(cell string) (int, int, error) {
//
// Example:
//
-// excelize.CoordinatesToCellName(1, 1) // returns "A1", nil
-// excelize.CoordinatesToCellName(1, 1, true) // returns "$A$1", nil
-//
+// excelize.CoordinatesToCellName(1, 1) // returns "A1", nil
+// excelize.CoordinatesToCellName(1, 1, true) // returns "$A$1", nil
func CoordinatesToCellName(col, row int, abs ...bool) (string, error) {
if col < 1 || row < 1 {
return "", fmt.Errorf("invalid cell coordinates [%d, %d]", col, row)
@@ -641,7 +636,7 @@ func (f *File) replaceNameSpaceBytes(path string, contentMarshal []byte) []byte
if attr, ok := f.xmlAttr[path]; ok {
newXmlns = []byte(genXMLNamespace(attr))
}
- return bytesReplace(contentMarshal, oldXmlns, newXmlns, -1)
+ return bytesReplace(contentMarshal, oldXmlns, bytes.ReplaceAll(newXmlns, []byte(" mc:Ignorable=\"r\""), []byte{}), -1)
}
// addNameSpaces provides a function to add an XML attribute by the given