This commit is contained in:
Liu Ming
2016-09-30 11:46:51 +08:00
parent 76d16d4682
commit cc2ab32c3f
3 changed files with 8 additions and 6 deletions

View File

@@ -115,10 +115,11 @@ func (wb *WorkBook) parseBof(buf io.ReadSeeker, b *bof, pre *bof, offset_pre int
var size uint16
var i = 0
for ; i < int(info.Count); i++ {
if err := binary.Read(buf_item, binary.LittleEndian, &size); err == nil || err == io.EOF {
if err := binary.Read(buf_item, binary.LittleEndian, &size); err == nil {
var str string
str, err = wb.get_string(buf_item, size)
wb.sst[i] = wb.sst[i] + str
if err == io.EOF {
break
}
@@ -284,6 +285,7 @@ func (w *WorkBook) ReadAllCells(max int) (res [][]string) {
data = append(data, make([]string, col.LastCol()-uint16(len(data))+1)...)
}
str := col.String(w)
for i := uint16(0); i < col.LastCol()-col.FirstCol()+1; i++ {
data[col.FirstCol()+i] = str[i]
}