summaryrefslogtreecommitdiff
path: root/sheet.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-01-23 00:32:34 +0800
committerxuri <xuri.me@gmail.com>2022-01-23 00:48:26 +0800
commit3ee3c38f9c63de3782fad21aae9c05ee0530fc32 (patch)
tree153928b23d79d259f6030cd902c836162f84e345 /sheet.go
parent74f6ea94eae45c8fb89a23cc94802e57ce279a84 (diff)
Fix file corrupted in some cases, check file extension and format code
Fix file corrupted when save as in XLAM / XLSM / XLTM / XLTX extension in some case New exported error ErrWorkbookExt has been added, and check file extension on save the workbook Format source code with `gofumpt`
Diffstat (limited to 'sheet.go')
-rw-r--r--sheet.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/sheet.go b/sheet.go
index 2426bf8..f10ca07 100644
--- a/sheet.go
+++ b/sheet.go
@@ -368,7 +368,7 @@ func (f *File) SetActiveSheet(index int) {
// GetActiveSheetIndex provides a function to get active sheet index of the
// spreadsheet. If not found the active sheet will be return integer 0.
func (f *File) GetActiveSheetIndex() (index int) {
- var sheetID = f.getActiveSheetID()
+ sheetID := f.getActiveSheetID()
wb := f.workbookReader()
if wb != nil {
for idx, sheet := range wb.Sheets.Sheet {
@@ -1723,7 +1723,7 @@ func (f *File) UngroupSheets() error {
func (f *File) InsertPageBreak(sheet, cell string) (err error) {
var ws *xlsxWorksheet
var row, col int
- var rowBrk, colBrk = -1, -1
+ rowBrk, colBrk := -1, -1
if ws, err = f.workSheetReader(sheet); err != nil {
return
}