diff --git a/workbook.go b/workbook.go index cb31c8c..1eadb77 100644 --- a/workbook.go +++ b/workbook.go @@ -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 { diff --git a/worksheet.go b/worksheet.go index 3d71e9b..17c3d64 100644 --- a/worksheet.go +++ b/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)