添加 sheet 是否隐藏接口
This commit is contained in:
parent
e9e7409707
commit
44e6d3affc
@ -3,6 +3,7 @@ package xls
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
"unicode/utf16"
|
||||
@ -136,6 +137,7 @@ func (wb *WorkBook) parseBof(buf io.ReadSeeker, b *bof, pre *bof, offset_pre int
|
||||
var bs = new(boundsheet)
|
||||
binary.Read(item, binary.LittleEndian, bs)
|
||||
// different for BIFF5 and BIFF8
|
||||
fmt.Println("bs:", *bs)
|
||||
wb.addSheet(bs, item)
|
||||
case XLS_Type_EXTERNSHEET:
|
||||
if !wb.Is5ver {
|
||||
|
14
worksheet.go
14
worksheet.go
@ -2,14 +2,15 @@ package xls
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"io"
|
||||
"unicode/utf16"
|
||||
)
|
||||
|
||||
type boundsheet struct {
|
||||
Filepos uint32
|
||||
Type byte
|
||||
Visible byte
|
||||
Type byte
|
||||
Name byte
|
||||
}
|
||||
|
||||
@ -37,6 +38,7 @@ type WorkSheet struct {
|
||||
parsed bool
|
||||
}
|
||||
|
||||
// Row return row data by number
|
||||
func (w *WorkSheet) Row(i int) *Row {
|
||||
row := w.rows[uint16(i)]
|
||||
if row != nil {
|
||||
@ -45,6 +47,16 @@ func (w *WorkSheet) Row(i int) *Row {
|
||||
return row
|
||||
}
|
||||
|
||||
// GetSheetVisible provides a function to get worksheet visible
|
||||
func (w *WorkSheet) GetSheetVisible() bool {
|
||||
fmt.Println("ws visible:", w.bs.Visible)
|
||||
if 0 == w.bs.Visible {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (w *WorkSheet) parse(buf io.ReadSeeker) {
|
||||
w.rows = make(map[uint16]*Row)
|
||||
b := new(bof)
|
||||
|
Loading…
x
Reference in New Issue
Block a user