diff options
author | xuri <xuri.me@gmail.com> | 2022-09-28 00:04:17 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-09-28 00:04:17 +0800 |
commit | efcf599dfe2ec25f10c4d55513a5648addfe989b (patch) | |
tree | 29da05dfcac18cbe2712ca8821376be4777c032d /adjust.go | |
parent | addcc1a0b257d3b71e33891891c3a3df4d34f0dc (diff) |
This closes #1360, closes #1361
- Fix default number format parse issue with a long string of digits
- Fix creating a sheet with an empty name cause a corrupted file
- The `GetCellStyle` function no longer return master cell style of the merge cell range
- Using the specialized name in variables and functions
Diffstat (limited to 'adjust.go')
-rw-r--r-- | adjust.go | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -185,7 +185,7 @@ func (f *File) adjustTable(ws *xlsxWorksheet, sheet string, dir adjustDirection, Decode(&t); err != nil && err != io.EOF { return } - coordinates, err := areaRefToCoordinates(t.Ref) + coordinates, err := rangeRefToCoordinates(t.Ref) if err != nil { return } @@ -204,7 +204,7 @@ func (f *File) adjustTable(ws *xlsxWorksheet, sheet string, dir adjustDirection, idx-- continue } - t.Ref, _ = f.coordinatesToAreaRef([]int{x1, y1, x2, y2}) + t.Ref, _ = f.coordinatesToRangeRef([]int{x1, y1, x2, y2}) if t.AutoFilter != nil { t.AutoFilter.Ref = t.Ref } @@ -221,7 +221,7 @@ func (f *File) adjustAutoFilter(ws *xlsxWorksheet, dir adjustDirection, num, off return nil } - coordinates, err := areaRefToCoordinates(ws.AutoFilter.Ref) + coordinates, err := rangeRefToCoordinates(ws.AutoFilter.Ref) if err != nil { return err } @@ -241,7 +241,7 @@ func (f *File) adjustAutoFilter(ws *xlsxWorksheet, dir adjustDirection, num, off coordinates = f.adjustAutoFilterHelper(dir, coordinates, num, offset) x1, y1, x2, y2 = coordinates[0], coordinates[1], coordinates[2], coordinates[3] - if ws.AutoFilter.Ref, err = f.coordinatesToAreaRef([]int{x1, y1, x2, y2}); err != nil { + if ws.AutoFilter.Ref, err = f.coordinatesToRangeRef([]int{x1, y1, x2, y2}); err != nil { return err } return nil @@ -277,8 +277,8 @@ func (f *File) adjustMergeCells(ws *xlsxWorksheet, dir adjustDirection, num, off } for i := 0; i < len(ws.MergeCells.Cells); i++ { - areaData := ws.MergeCells.Cells[i] - coordinates, err := areaRefToCoordinates(areaData.Ref) + mergedCells := ws.MergeCells.Cells[i] + coordinates, err := rangeRefToCoordinates(mergedCells.Ref) if err != nil { return err } @@ -305,8 +305,8 @@ func (f *File) adjustMergeCells(ws *xlsxWorksheet, dir adjustDirection, num, off i-- continue } - areaData.rect = []int{x1, y1, x2, y2} - if areaData.Ref, err = f.coordinatesToAreaRef([]int{x1, y1, x2, y2}); err != nil { + mergedCells.rect = []int{x1, y1, x2, y2} + if mergedCells.Ref, err = f.coordinatesToRangeRef([]int{x1, y1, x2, y2}); err != nil { return err } } |