Checked in attachment #163935 for bug 248884:

big calendar (ics more than 64k) is broken
This commit is contained in:
mostafah%oeone.com 2004-11-01 20:59:56 +00:00
parent a987ced0af
commit a958804cdd

View File

@ -702,8 +702,21 @@ calendarManager.prototype.getRemoteCalendarText = function calMan_getRemoteCalen
.getService(Components.interfaces.nsIPromptService);
var retval = false;
if( typeof( result ) != "string" ) //for 1.7 compatibility
result = String.fromCharCode.apply(this, result);
if( typeof( result ) != "string" ) { //for 1.7 compatibility
// Result is an array of integer unicode values.
// Convert to string by applying String.fromCharCode static function.
// Function.apply can take array of length < expt(2, 16),
// so convert slices half that length to strings, then join strings.
var sliceStringArray = new Array();
for (var start = 0, end;
start < (end = Math.min(result.length, start + 32768));
start = end) {
var slice = result.slice(start, end);
var sliceString = String.fromCharCode.apply(null, slice);
sliceStringArray[sliceStringArray.length] = sliceString;
}
result = sliceStringArray.join("");
}
var ch;
try {