@@ -11380,9 +11380,12 @@ var PtgBinOp = {
11380
11380
PtgPower: "^",
11381
11381
PtgSub: "-"
11382
11382
};
11383
+
11384
+ // List of invalid characters needs to be tested further
11385
+ var quoteCharacters /*:RegExp */ = new RegExp(/[^\w\u4E00-\u9FFF\u3040-\u30FF]/)
11383
11386
function formula_quote_sheet_name(sname/*:string*/, opts)/*:string*/ {
11384
11387
if(!sname && !(opts && opts.biff <= 5 && opts.biff >= 2)) throw new Error("empty sheet name");
11385
- if(sname.indexOf(" ") > -1 ) return "'" + sname + "'";
11388
+ if (quoteCharacters.test(sname) ) return "'" + sname + "'";
11386
11389
return sname;
11387
11390
}
11388
11391
function get_ixti_raw(supbooks, ixti/*:number*/, opts)/*:string*/ {
@@ -20994,13 +20997,13 @@ function write_zip(wb/*:Workbook*/, opts/*:WriteOpts*/)/*:ZIP*/ {
20994
20997
function firstbyte(f/*:RawData*/,o/*:?TypeOpts*/)/*:Array<number>*/ {
20995
20998
var x = "";
20996
20999
switch((o||{}).type || "base64") {
20997
- case 'buffer': return [f[0], f[1], f[2], f[3]];
20998
- case 'base64': x = Base64.decode(f.slice(0,24 )); break;
21000
+ case 'buffer': return [f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7] ];
21001
+ case 'base64': x = Base64.decode(f.slice(0,12 )); break;
20999
21002
case 'binary': x = f; break;
21000
- case 'array': return [f[0], f[1], f[2], f[3]];
21003
+ case 'array': return [f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7] ];
21001
21004
default: throw new Error("Unrecognized type " + (o && o.type || "undefined"));
21002
21005
}
21003
- return [x.charCodeAt(0), x.charCodeAt(1), x.charCodeAt(2), x.charCodeAt(3)];
21006
+ return [x.charCodeAt(0), x.charCodeAt(1), x.charCodeAt(2), x.charCodeAt(3), x.charCodeAt(4), x.charCodeAt(5), x.charCodeAt(6), x.charCodeAt(7) ];
21004
21007
}
21005
21008
21006
21009
function read_cfb(cfb/*:CFBContainer*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
@@ -21075,7 +21078,7 @@ function readSync(data/*:RawData*/, opts/*:?ParseOpts*/)/*:Workbook*/ {
21075
21078
if(!vu.foo) {o=dup(o); o.type='array'; return readSync(ab2a(d), o);}
21076
21079
}
21077
21080
switch((n = firstbyte(d, o))[0]) {
21078
- case 0xD0: return read_cfb(CFB.read(d, o), o);
21081
+ case 0xD0: if(n[1] === 0xCF && n[2] === 0x11 && n[3] === 0xE0 && n[4] === 0xA1 && n[5] === 0xB1 && n[6] === 0x1A && n[7] === 0xE1) return read_cfb(CFB.read(d, o), o); break ;
21079
21082
case 0x09: if(n[1] <= 0x04) return parse_xlscfb(d, o); break;
21080
21083
case 0x3C: return parse_xlml(d, o);
21081
21084
case 0x49: if(n[1] === 0x44) return read_wb_ID(d, o); break;
0 commit comments