@@ -78,8 +78,8 @@ func (wb *WorkBook) parseBof(buf io.ReadSeeker, b *bof, pre *bof, offset_pre int
78
78
wb .Type = bif .Type
79
79
case 0x0042 : // CODEPAGE
80
80
binary .Read (item , binary .LittleEndian , & wb .Codepage )
81
- case 0x3C : // CONTINUE
82
- if pre .Id == 0xfc {
81
+ case 0x003c : // SST CONTINUE identifier
82
+ if pre .Id == 0x00fc {
83
83
var size uint16
84
84
var err error
85
85
if wb .continue_utf16 >= 1 {
@@ -106,7 +106,7 @@ func (wb *WorkBook) parseBof(buf io.ReadSeeker, b *bof, pre *bof, offset_pre int
106
106
offset = offset_pre
107
107
after = pre
108
108
after_using = b
109
- case 0x00FC : // SST
109
+ case 0x00fc : // SST identifier
110
110
info := new (SstInfo )
111
111
binary .Read (item , binary .LittleEndian , info )
112
112
wb .sst = make ([]string , info .Count )
@@ -150,7 +150,7 @@ func (wb *WorkBook) parseBof(buf io.ReadSeeker, b *bof, pre *bof, offset_pre int
150
150
f := new (FontInfo )
151
151
binary .Read (item , binary .LittleEndian , f )
152
152
wb .addFont (f , item )
153
- case 0x041E : //FORMAT
153
+ case 0x041e : //FORMAT
154
154
format := new (Format )
155
155
binary .Read (item , binary .LittleEndian , & format .Head )
156
156
if raw , err := wb .parseString (item , format .Head .Size ); nil == err && "" != raw {
@@ -214,18 +214,24 @@ func (w *WorkBook) parseString(buf io.ReadSeeker, size uint16) (res string, err
214
214
var phonetic_size = uint32 (0 )
215
215
var flag byte
216
216
err = binary .Read (buf , binary .LittleEndian , & flag )
217
+
218
+ // Rich-Text settings (richtext)
217
219
if flag & 0x8 != 0 {
218
220
err = binary .Read (buf , binary .LittleEndian , & richtext_num )
219
221
} else if w .continue_rich > 0 {
220
222
richtext_num = w .continue_rich
221
223
w .continue_rich = 0
222
224
}
225
+
226
+ // Asian phonetic settings
223
227
if flag & 0x4 != 0 {
224
228
err = binary .Read (buf , binary .LittleEndian , & phonetic_size )
225
229
} else if w .continue_apsb > 0 {
226
230
phonetic_size = w .continue_apsb
227
231
w .continue_apsb = 0
228
232
}
233
+
234
+ // Character compression
229
235
if flag & 0x1 != 0 {
230
236
var bts = make ([]uint16 , size )
231
237
var i = uint16 (0 )
@@ -253,6 +259,7 @@ func (w *WorkBook) parseString(buf io.ReadSeeker, size uint16) (res string, err
253
259
runes := utf16 .Decode (bts1 )
254
260
res = strings .Trim (string (runes ), "\r \n \t " )
255
261
}
262
+
256
263
if richtext_num > 0 {
257
264
var ss int64
258
265
if w .Is5ver {
0 commit comments