summaryrefslogtreecommitdiff
path: root/sheetview.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 /sheetview.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 'sheetview.go')
-rw-r--r--sheetview.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/sheetview.go b/sheetview.go
index a47d510..9845942 100644
--- a/sheetview.go
+++ b/sheetview.go
@@ -11,8 +11,6 @@
package excelize
-import "fmt"
-
// getSheetView returns the SheetView object
func (f *File) getSheetView(sheet string, viewIndex int) (*xlsxSheetView, error) {
ws, err := f.workSheetReader(sheet)
@@ -26,11 +24,11 @@ func (f *File) getSheetView(sheet string, viewIndex int) (*xlsxSheetView, error)
}
if viewIndex < 0 {
if viewIndex < -len(ws.SheetViews.SheetView) {
- return nil, fmt.Errorf("view index %d out of range", viewIndex)
+ return nil, newViewIdxError(viewIndex)
}
viewIndex = len(ws.SheetViews.SheetView) + viewIndex
} else if viewIndex >= len(ws.SheetViews.SheetView) {
- return nil, fmt.Errorf("view index %d out of range", viewIndex)
+ return nil, newViewIdxError(viewIndex)
}
return &(ws.SheetViews.SheetView[viewIndex]), err