From a410b22bdd50e9f212b0b454e5aed798e3476394 Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 28 Oct 2022 00:31:55 +0800 Subject: 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 --- sheetview.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sheetview.go') 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 -- cgit v1.2.1