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