Fixing one-off error in imputing range with gdocs

Fixes #9

Note: Google Docs does not generate a 'spans' attribute, but opening and saving
with Excel appears to resolve the issue.
This commit is contained in:
SheetJS 2013-03-14 21:15:34 -04:00
parent 372949ae82
commit 378991cb30

@ -111,8 +111,8 @@ function parseSheet(data) { //TODO: use a real xml parser
var cells = x.substr(x.indexOf('>')+1).split(/<c/);
cells.forEach(function(c, idx) { if(c === "") return;
c = "<c" + c;
if(refguess.s.c > idx) refguess.s.c = idx;
if(refguess.e.c < idx) refguess.e.c = idx;
if(refguess.s.c > idx - 1) refguess.s.c = idx - 1;
if(refguess.e.c < idx - 1) refguess.e.c = idx - 1;
var cell = parsexmltag((c.match(/<c[^>]*>/)||[c])[0]); delete cell[0];
var d = c.substr(c.indexOf('>')+1);
var p = {};
@ -191,7 +191,7 @@ function parseProps(data) {
switch(v[i].v) {
case "Worksheets": widx = j; p["Worksheets"] = +v[++i]; break;
case "Named Ranges": ++i; break; // TODO: Handle Named Ranges
default: throw "Unrecognized key in Heading Pairs: " + v[i].v;
default: console.error("Unrecognized key in Heading Pairs: " + v[i++].v);
}
}
var parts = parseVector(q["TitlesOfParts"]);