20
0

添加 sheet 是否隐藏接口

This commit is contained in:
chen.s.g 2020-05-18 14:37:43 +08:00
parent e9e7409707
commit 44e6d3affc
2 changed files with 15 additions and 1 deletions

View File

@ -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 {

View File

@ -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)