2017-05-09 18:07:57 +00:00
|
|
|
function write_UInt32LE(x/*:number*/, o) {
|
2020-07-18 01:14:13 +00:00
|
|
|
if (!o) o = new_buf(4);
|
2017-05-09 18:07:57 +00:00
|
|
|
o.write_shift(4, x);
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* [MS-XLSB] 2.5.168 */
|
2017-07-05 22:27:54 +00:00
|
|
|
function parse_XLWideString(data/*::, length*/)/*:string*/ {
|
2017-05-09 18:07:57 +00:00
|
|
|
var cchCharacters = data.read_shift(4);
|
|
|
|
return cchCharacters === 0 ? "" : data.read_shift(cchCharacters, 'dbcs');
|
|
|
|
}
|
|
|
|
function write_XLWideString(data/*:string*/, o) {
|
2020-07-18 01:14:13 +00:00
|
|
|
var _null = false; if (o == null) { _null = true; o = new_buf(4 + 2 * data.length); }
|
2017-05-09 18:07:57 +00:00
|
|
|
o.write_shift(4, data.length);
|
2020-07-18 01:14:13 +00:00
|
|
|
if (data.length > 0) o.write_shift(0, data, 'dbcs');
|
2017-05-09 18:07:57 +00:00
|
|
|
return _null ? o.slice(0, o.l) : o;
|
|
|
|
}
|
2014-02-12 06:09:42 +00:00
|
|
|
|
2020-03-15 07:42:05 +00:00
|
|
|
/* [MS-XLSB] 2.5.91 */
|
|
|
|
//function parse_LPWideString(data/*::, length*/)/*:string*/ {
|
|
|
|
// var cchCharacters = data.read_shift(2);
|
|
|
|
// return cchCharacters === 0 ? "" : data.read_shift(cchCharacters, "utf16le");
|
|
|
|
//}
|
|
|
|
|
2014-02-12 06:09:42 +00:00
|
|
|
/* [MS-XLSB] 2.5.143 */
|
2018-01-23 09:07:51 +00:00
|
|
|
function parse_StrRun(data) {
|
2014-02-12 06:09:42 +00:00
|
|
|
return { ich: data.read_shift(2), ifnt: data.read_shift(2) };
|
2014-06-29 18:29:45 +00:00
|
|
|
}
|
2017-05-09 18:07:57 +00:00
|
|
|
function write_StrRun(run, o) {
|
2020-07-18 01:14:13 +00:00
|
|
|
if (!o) o = new_buf(4);
|
2017-05-09 18:07:57 +00:00
|
|
|
o.write_shift(2, run.ich || 0);
|
|
|
|
o.write_shift(2, run.ifnt || 0);
|
|
|
|
return o;
|
|
|
|
}
|
2014-02-12 06:09:42 +00:00
|
|
|
|
2018-02-14 20:06:35 +00:00
|
|
|
/* [MS-XLSB] 2.5.121 */
|
2017-03-12 18:02:43 +00:00
|
|
|
function parse_RichStr(data, length/*:number*/)/*:XLString*/ {
|
2014-01-28 16:38:02 +00:00
|
|
|
var start = data.l;
|
|
|
|
var flags = data.read_shift(1);
|
|
|
|
var str = parse_XLWideString(data);
|
2014-02-12 06:09:42 +00:00
|
|
|
var rgsStrRun = [];
|
2017-02-10 19:23:01 +00:00
|
|
|
var z = ({ t: str, h: str }/*:any*/);
|
2020-07-18 01:14:13 +00:00
|
|
|
if ((flags & 1) !== 0) { /* fRichStr */
|
2014-01-28 16:38:02 +00:00
|
|
|
/* TODO: formatted string */
|
|
|
|
var dwSizeStrRun = data.read_shift(4);
|
2020-07-18 01:14:13 +00:00
|
|
|
for (var i = 0; i != dwSizeStrRun; ++i) rgsStrRun.push(parse_StrRun(data));
|
2014-06-29 18:29:45 +00:00
|
|
|
z.r = rgsStrRun;
|
2014-01-28 16:38:02 +00:00
|
|
|
}
|
2020-07-18 01:14:13 +00:00
|
|
|
else z.r = [{ ich: 0, ifnt: 0 }];
|
2017-03-31 00:47:35 +00:00
|
|
|
//if((flags & 2) !== 0) { /* fExtStr */
|
|
|
|
// /* TODO: phonetic string */
|
|
|
|
//}
|
2014-01-28 16:38:02 +00:00
|
|
|
data.l = start + length;
|
|
|
|
return z;
|
2014-06-29 18:29:45 +00:00
|
|
|
}
|
2017-03-12 18:02:43 +00:00
|
|
|
function write_RichStr(str/*:XLString*/, o/*:?Block*/)/*:Block*/ {
|
2014-07-28 13:22:32 +00:00
|
|
|
/* TODO: formatted string */
|
2020-07-18 01:14:13 +00:00
|
|
|
var _null = false; if (o == null) { _null = true; o = new_buf(15 + 4 * str.t.length); }
|
|
|
|
o.write_shift(1, 0);
|
2014-07-28 13:22:32 +00:00
|
|
|
write_XLWideString(str.t, o);
|
2017-04-02 06:47:25 +00:00
|
|
|
return _null ? o.slice(0, o.l) : o;
|
2014-07-28 13:22:32 +00:00
|
|
|
}
|
2018-02-14 20:06:35 +00:00
|
|
|
/* [MS-XLSB] 2.4.328 BrtCommentText (RichStr w/1 run) */
|
2017-05-09 18:07:57 +00:00
|
|
|
var parse_BrtCommentText = parse_RichStr;
|
|
|
|
function write_BrtCommentText(str/*:XLString*/, o/*:?Block*/)/*:Block*/ {
|
|
|
|
/* TODO: formatted string */
|
2020-07-18 01:14:13 +00:00
|
|
|
var _null = false; if (o == null) { _null = true; o = new_buf(23 + 4 * str.t.length); }
|
|
|
|
o.write_shift(1, 1);
|
2017-05-09 18:07:57 +00:00
|
|
|
write_XLWideString(str.t, o);
|
2020-07-18 01:14:13 +00:00
|
|
|
o.write_shift(4, 1);
|
|
|
|
write_StrRun({ ich: 0, ifnt: 0 }, o);
|
2017-05-09 18:07:57 +00:00
|
|
|
return _null ? o.slice(0, o.l) : o;
|
|
|
|
}
|
2014-01-28 16:38:02 +00:00
|
|
|
|
|
|
|
/* [MS-XLSB] 2.5.9 */
|
2017-03-12 18:02:43 +00:00
|
|
|
function parse_XLSBCell(data)/*:any*/ {
|
2014-01-28 16:38:02 +00:00
|
|
|
var col = data.read_shift(4);
|
|
|
|
var iStyleRef = data.read_shift(2);
|
2020-07-18 01:14:13 +00:00
|
|
|
iStyleRef += data.read_shift(1) << 16;
|
2018-01-23 09:07:51 +00:00
|
|
|
data.l++; //var fPhShow = data.read_shift(1);
|
2020-07-18 01:14:13 +00:00
|
|
|
return { c: col, iStyleRef: iStyleRef };
|
2014-01-28 16:38:02 +00:00
|
|
|
}
|
2017-03-12 18:02:43 +00:00
|
|
|
function write_XLSBCell(cell/*:any*/, o/*:?Block*/) {
|
2020-07-18 01:14:13 +00:00
|
|
|
if (o == null) o = new_buf(8);
|
2014-07-28 13:22:32 +00:00
|
|
|
o.write_shift(-4, cell.c);
|
2017-02-10 19:23:01 +00:00
|
|
|
o.write_shift(3, cell.iStyleRef || cell.s);
|
2014-07-28 13:22:32 +00:00
|
|
|
o.write_shift(1, 0); /* fPhShow */
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
2021-08-18 18:34:02 +00:00
|
|
|
/* Short XLSB Cell does not include column */
|
|
|
|
function parse_XLSBShortCell(data)/*:any*/ {
|
|
|
|
var iStyleRef = data.read_shift(2);
|
|
|
|
iStyleRef += data.read_shift(1) <<16;
|
|
|
|
data.l++; //var fPhShow = data.read_shift(1);
|
|
|
|
return { c:-1, iStyleRef: iStyleRef };
|
|
|
|
}
|
|
|
|
function write_XLSBShortCell(cell/*:any*/, o/*:?Block*/) {
|
|
|
|
if(o == null) o = new_buf(4);
|
|
|
|
o.write_shift(3, cell.iStyleRef || cell.s);
|
|
|
|
o.write_shift(1, 0); /* fPhShow */
|
|
|
|
return o;
|
|
|
|
}
|
2014-01-28 16:38:02 +00:00
|
|
|
|
|
|
|
/* [MS-XLSB] 2.5.21 */
|
2017-03-31 00:47:35 +00:00
|
|
|
var parse_XLSBCodeName = parse_XLWideString;
|
|
|
|
var write_XLSBCodeName = write_XLWideString;
|
2014-01-28 16:38:02 +00:00
|
|
|
|
2014-05-29 22:30:03 +00:00
|
|
|
/* [MS-XLSB] 2.5.166 */
|
2017-07-05 22:27:54 +00:00
|
|
|
function parse_XLNullableWideString(data/*::, length*/)/*:string*/ {
|
2014-05-29 22:30:03 +00:00
|
|
|
var cchCharacters = data.read_shift(4);
|
2014-06-29 18:29:45 +00:00
|
|
|
return cchCharacters === 0 || cchCharacters === 0xFFFFFFFF ? "" : data.read_shift(cchCharacters, 'dbcs');
|
|
|
|
}
|
2017-02-10 19:23:01 +00:00
|
|
|
function write_XLNullableWideString(data/*:string*/, o) {
|
2020-07-18 01:14:13 +00:00
|
|
|
var _null = false; if (o == null) { _null = true; o = new_buf(127); }
|
2014-06-29 18:29:45 +00:00
|
|
|
o.write_shift(4, data.length > 0 ? data.length : 0xFFFFFFFF);
|
2020-07-18 01:14:13 +00:00
|
|
|
if (data.length > 0) o.write_shift(0, data, 'dbcs');
|
2017-04-02 06:47:25 +00:00
|
|
|
return _null ? o.slice(0, o.l) : o;
|
2014-06-29 18:29:45 +00:00
|
|
|
}
|
2014-05-29 22:30:03 +00:00
|
|
|
|
2017-02-19 20:36:32 +00:00
|
|
|
/* [MS-XLSB] 2.5.165 */
|
|
|
|
var parse_XLNameWideString = parse_XLWideString;
|
2018-01-23 09:07:51 +00:00
|
|
|
//var write_XLNameWideString = write_XLWideString;
|
2017-02-19 20:36:32 +00:00
|
|
|
|
2014-01-28 16:38:02 +00:00
|
|
|
/* [MS-XLSB] 2.5.114 */
|
2014-05-29 22:30:03 +00:00
|
|
|
var parse_RelID = parse_XLNullableWideString;
|
|
|
|
var write_RelID = write_XLNullableWideString;
|
|
|
|
|
2014-01-28 16:38:02 +00:00
|
|
|
|
2018-02-14 20:06:35 +00:00
|
|
|
/* [MS-XLS] 2.5.217 ; [MS-XLSB] 2.5.122 */
|
2017-02-10 19:23:01 +00:00
|
|
|
function parse_RkNumber(data)/*:number*/ {
|
2020-07-18 01:14:13 +00:00
|
|
|
var b = data.slice(data.l, data.l + 4);
|
2018-02-08 18:21:39 +00:00
|
|
|
var fX100 = (b[0] & 1), fInt = (b[0] & 2);
|
2020-07-18 01:14:13 +00:00
|
|
|
data.l += 4;
|
2015-04-02 20:32:22 +00:00
|
|
|
b[0] &= 0xFC; // b[0] &= ~3;
|
2020-07-18 01:14:13 +00:00
|
|
|
var RK = fInt === 0 ? __double([0, 0, 0, 0, b[0], b[1], b[2], b[3]], 0) : __readInt32LE(b, 0) >> 2;
|
|
|
|
return fX100 ? (RK / 100) : RK;
|
2014-01-28 16:38:02 +00:00
|
|
|
}
|
2017-02-03 20:50:45 +00:00
|
|
|
function write_RkNumber(data/*:number*/, o) {
|
2020-07-18 01:14:13 +00:00
|
|
|
if (o == null) o = new_buf(4);
|
2017-02-03 20:50:45 +00:00
|
|
|
var fX100 = 0, fInt = 0, d100 = data * 100;
|
2020-07-18 01:14:13 +00:00
|
|
|
if ((data == (data | 0)) && (data >= -(1 << 29)) && (data < (1 << 29))) { fInt = 1; }
|
|
|
|
else if ((d100 == (d100 | 0)) && (d100 >= -(1 << 29)) && (d100 < (1 << 29))) { fInt = 1; fX100 = 1; }
|
|
|
|
if (fInt) o.write_shift(-4, ((fX100 ? d100 : data) << 2) + (fX100 + 2));
|
2017-02-03 20:50:45 +00:00
|
|
|
else throw new Error("unsupported RkNumber " + data); // TODO
|
|
|
|
}
|
|
|
|
|
2014-01-28 16:38:02 +00:00
|
|
|
|
2017-02-19 20:36:32 +00:00
|
|
|
/* [MS-XLSB] 2.5.117 RfX */
|
2017-07-05 22:27:54 +00:00
|
|
|
function parse_RfX(data /*::, length*/)/*:Range*/ {
|
2020-07-18 01:14:13 +00:00
|
|
|
var cell/*:Range*/ = ({ s: {}, e: {} }/*:any*/);
|
2014-01-28 16:38:02 +00:00
|
|
|
cell.s.r = data.read_shift(4);
|
|
|
|
cell.e.r = data.read_shift(4);
|
|
|
|
cell.s.c = data.read_shift(4);
|
|
|
|
cell.e.c = data.read_shift(4);
|
|
|
|
return cell;
|
2014-06-29 18:29:45 +00:00
|
|
|
}
|
2017-02-19 20:36:32 +00:00
|
|
|
function write_RfX(r/*:Range*/, o) {
|
2020-07-18 01:14:13 +00:00
|
|
|
if (!o) o = new_buf(16);
|
2014-05-29 22:30:03 +00:00
|
|
|
o.write_shift(4, r.s.r);
|
|
|
|
o.write_shift(4, r.e.r);
|
|
|
|
o.write_shift(4, r.s.c);
|
|
|
|
o.write_shift(4, r.e.c);
|
|
|
|
return o;
|
2014-06-29 18:29:45 +00:00
|
|
|
}
|
2014-01-28 16:38:02 +00:00
|
|
|
|
2017-02-19 20:36:32 +00:00
|
|
|
/* [MS-XLSB] 2.5.153 UncheckedRfX */
|
|
|
|
var parse_UncheckedRfX = parse_RfX;
|
|
|
|
var write_UncheckedRfX = write_RfX;
|
|
|
|
|
2020-03-15 07:42:05 +00:00
|
|
|
/* [MS-XLSB] 2.5.155 UncheckedSqRfX */
|
|
|
|
//function parse_UncheckedSqRfX(data) {
|
|
|
|
// var cnt = data.read_shift(4);
|
|
|
|
// var out = [];
|
|
|
|
// for(var i = 0; i < cnt; ++i) {
|
|
|
|
// var rng = parse_UncheckedRfX(data);
|
|
|
|
// out.push(encode_range(rng));
|
|
|
|
// }
|
|
|
|
// return out.join(",");
|
|
|
|
//}
|
|
|
|
//function write_UncheckedSqRfX(sqrfx/*:string*/) {
|
|
|
|
// var parts = sqrfx.split(/\s*,\s*/);
|
|
|
|
// var o = new_buf(4); o.write_shift(4, parts.length);
|
|
|
|
// var out = [o];
|
|
|
|
// parts.forEach(function(rng) {
|
|
|
|
// out.push(write_UncheckedRfX(safe_decode_range(rng)));
|
|
|
|
// });
|
|
|
|
// return bconcat(out);
|
|
|
|
//}
|
2019-11-01 03:09:14 +00:00
|
|
|
|
2018-02-14 20:06:35 +00:00
|
|
|
/* [MS-XLS] 2.5.342 ; [MS-XLSB] 2.5.171 */
|
2017-02-03 20:50:45 +00:00
|
|
|
/* TODO: error checking, NaN and Infinity values are not valid Xnum */
|
2021-05-13 19:02:31 +00:00
|
|
|
function parse_Xnum(data/*::, length*/) {
|
|
|
|
if(data.length - data.l < 8) throw "XLS Xnum Buffer underflow";
|
|
|
|
return data.read_shift(8, 'f');
|
|
|
|
}
|
2017-02-03 20:50:45 +00:00
|
|
|
function write_Xnum(data, o) { return (o || new_buf(8)).write_shift(8, data, 'f'); }
|
2014-01-28 16:38:02 +00:00
|
|
|
|
2018-02-14 20:06:35 +00:00
|
|
|
/* [MS-XLSB] 2.4.324 BrtColor */
|
2018-01-23 09:07:51 +00:00
|
|
|
function parse_BrtColor(data/*::, length*/) {
|
2014-03-29 02:05:50 +00:00
|
|
|
var out = {};
|
2014-06-29 18:29:45 +00:00
|
|
|
var d = data.read_shift(1);
|
2017-05-09 18:07:57 +00:00
|
|
|
|
2018-01-23 09:07:51 +00:00
|
|
|
//var fValidRGB = d & 1;
|
2017-05-09 18:07:57 +00:00
|
|
|
var xColorType = d >>> 1;
|
|
|
|
|
|
|
|
var index = data.read_shift(1);
|
|
|
|
var nTS = data.read_shift(2, 'i');
|
|
|
|
var bR = data.read_shift(1);
|
|
|
|
var bG = data.read_shift(1);
|
|
|
|
var bB = data.read_shift(1);
|
2018-01-23 09:07:51 +00:00
|
|
|
data.l++; //var bAlpha = data.read_shift(1);
|
2017-05-09 18:07:57 +00:00
|
|
|
|
2020-07-18 01:14:13 +00:00
|
|
|
switch (xColorType) {
|
2017-05-09 18:07:57 +00:00
|
|
|
case 0: out.auto = 1; break;
|
|
|
|
case 1:
|
|
|
|
out.index = index;
|
|
|
|
var icv = XLSIcv[index];
|
|
|
|
/* automatic pseudo index 81 */
|
2020-07-18 01:14:13 +00:00
|
|
|
if (icv) out.rgb = rgb2Hex(icv);
|
2017-05-09 18:07:57 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
/* if(!fValidRGB) throw new Error("invalid"); */
|
2017-07-27 20:07:51 +00:00
|
|
|
out.rgb = rgb2Hex([bR, bG, bB]);
|
2017-05-09 18:07:57 +00:00
|
|
|
break;
|
|
|
|
case 3: out.theme = index; break;
|
|
|
|
}
|
2020-07-18 01:14:13 +00:00
|
|
|
if (nTS != 0) out.tint = nTS > 0 ? nTS / 32767 : nTS / 32768;
|
2017-05-09 18:07:57 +00:00
|
|
|
|
|
|
|
return out;
|
|
|
|
}
|
|
|
|
function write_BrtColor(color, o) {
|
2020-07-18 01:14:13 +00:00
|
|
|
if (!o) o = new_buf(8);
|
|
|
|
if (!color || color.auto) { o.write_shift(4, 0); o.write_shift(4, 0); return o; }
|
|
|
|
if (color.index != null) {
|
2017-05-09 18:07:57 +00:00
|
|
|
o.write_shift(1, 0x02);
|
|
|
|
o.write_shift(1, color.index);
|
2020-07-18 01:14:13 +00:00
|
|
|
} else if (color.theme != null) {
|
2017-05-09 18:07:57 +00:00
|
|
|
o.write_shift(1, 0x06);
|
|
|
|
o.write_shift(1, color.theme);
|
|
|
|
} else {
|
|
|
|
o.write_shift(1, 0x05);
|
|
|
|
o.write_shift(1, 0);
|
|
|
|
}
|
|
|
|
var nTS = color.tint || 0;
|
2020-07-18 01:14:13 +00:00
|
|
|
if (nTS > 0) nTS *= 32767;
|
|
|
|
else if (nTS < 0) nTS *= 32768;
|
2017-05-09 18:07:57 +00:00
|
|
|
o.write_shift(2, nTS);
|
2020-07-18 01:14:13 +00:00
|
|
|
if (!color.rgb || color.theme != null) {
|
2017-05-09 18:07:57 +00:00
|
|
|
o.write_shift(2, 0);
|
|
|
|
o.write_shift(1, 0);
|
|
|
|
o.write_shift(1, 0);
|
|
|
|
} else {
|
|
|
|
var rgb = (color.rgb || 'FFFFFF');
|
2020-07-18 01:14:13 +00:00
|
|
|
if (typeof rgb == 'number') rgb = ("000000" + rgb.toString(16)).slice(-6);
|
|
|
|
o.write_shift(1, parseInt(rgb.slice(0, 2), 16));
|
|
|
|
o.write_shift(1, parseInt(rgb.slice(2, 4), 16));
|
|
|
|
o.write_shift(1, parseInt(rgb.slice(4, 6), 16));
|
2017-05-09 18:07:57 +00:00
|
|
|
o.write_shift(1, 0xFF);
|
|
|
|
}
|
|
|
|
return o;
|
2014-03-29 02:05:50 +00:00
|
|
|
}
|
|
|
|
|
2014-05-29 22:30:03 +00:00
|
|
|
/* [MS-XLSB] 2.5.52 */
|
2018-01-23 09:07:51 +00:00
|
|
|
function parse_FontFlags(data/*::, length, opts*/) {
|
2014-03-29 02:05:50 +00:00
|
|
|
var d = data.read_shift(1);
|
|
|
|
data.l++;
|
|
|
|
var out = {
|
2019-11-01 03:09:14 +00:00
|
|
|
fBold: d & 0x01,
|
2017-05-09 18:07:57 +00:00
|
|
|
fItalic: d & 0x02,
|
2019-11-01 03:09:14 +00:00
|
|
|
fUnderline: d & 0x04,
|
2017-05-09 18:07:57 +00:00
|
|
|
fStrikeout: d & 0x08,
|
2014-03-29 02:05:50 +00:00
|
|
|
fOutline: d & 0x10,
|
|
|
|
fShadow: d & 0x20,
|
|
|
|
fCondense: d & 0x40,
|
2014-05-17 18:57:29 +00:00
|
|
|
fExtend: d & 0x80
|
2014-03-29 02:05:50 +00:00
|
|
|
};
|
|
|
|
return out;
|
|
|
|
}
|
2017-05-09 18:07:57 +00:00
|
|
|
function write_FontFlags(font, o) {
|
2020-07-18 01:14:13 +00:00
|
|
|
if (!o) o = new_buf(2);
|
2017-05-09 18:07:57 +00:00
|
|
|
var grbit =
|
2020-07-18 01:14:13 +00:00
|
|
|
(font.italic ? 0x02 : 0) |
|
|
|
|
(font.strike ? 0x08 : 0) |
|
|
|
|
(font.outline ? 0x10 : 0) |
|
|
|
|
(font.shadow ? 0x20 : 0) |
|
2017-05-09 18:07:57 +00:00
|
|
|
(font.condense ? 0x40 : 0) |
|
2020-07-18 01:14:13 +00:00
|
|
|
(font.extend ? 0x80 : 0);
|
2017-05-09 18:07:57 +00:00
|
|
|
o.write_shift(1, grbit);
|
|
|
|
o.write_shift(1, 0);
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
2017-12-30 05:40:35 +00:00
|
|
|
/* [MS-OLEDS] 2.3.1 and 2.3.2 */
|
|
|
|
function parse_ClipboardFormatOrString(o, w/*:number*/)/*:string*/ {
|
|
|
|
// $FlowIgnore
|
2020-07-18 01:14:13 +00:00
|
|
|
var ClipFmt = { 2: "BITMAP", 3: "METAFILEPICT", 8: "DIB", 14: "ENHMETAFILE" };
|
2017-12-30 05:40:35 +00:00
|
|
|
var m/*:number*/ = o.read_shift(4);
|
2020-07-18 01:14:13 +00:00
|
|
|
switch (m) {
|
2017-12-30 05:40:35 +00:00
|
|
|
case 0x00000000: return "";
|
2020-07-18 01:14:13 +00:00
|
|
|
case 0xffffffff: case 0xfffffffe: return ClipFmt[o.read_shift(4)] || "";
|
2017-12-30 05:40:35 +00:00
|
|
|
}
|
2020-07-18 01:14:13 +00:00
|
|
|
if (m > 0x190) throw new Error("Unsupported Clipboard: " + m.toString(16));
|
2017-12-30 05:40:35 +00:00
|
|
|
o.l -= 4;
|
|
|
|
return o.read_shift(0, w == 1 ? "lpstr" : "lpwstr");
|
|
|
|
}
|
|
|
|
function parse_ClipboardFormatOrAnsiString(o) { return parse_ClipboardFormatOrString(o, 1); }
|
|
|
|
function parse_ClipboardFormatOrUnicodeString(o) { return parse_ClipboardFormatOrString(o, 2); }
|
|
|
|
|