Address comments for xref bug.

This commit is contained in:
Kalervo Kujala 2011-09-03 22:28:45 +03:00
parent 5ab01e2cd0
commit 2b5ed9b0fc

8
pdf.js
View File

@ -3546,8 +3546,8 @@ var Catalog = (function() {
} }
}, },
get destinations() { get destinations() {
function fetchDestination(ref) { function fetchDestination(xref, ref) {
var dest = this.xref.fetchIfRef(ref); var dest = xref.fetchIfRef(ref);
return IsDict(dest) ? dest.get('D') : dest; return IsDict(dest) ? dest.get('D') : dest;
} }
@ -3564,7 +3564,7 @@ var Catalog = (function() {
obj = xref.fetchIfRef(nameDictionaryRef); obj = xref.fetchIfRef(nameDictionaryRef);
obj.forEach(function(key, value) { obj.forEach(function(key, value) {
if (!value) return; if (!value) return;
dests[key] = fetchDestination(value); dests[key] = fetchDestination(xref, value);
}); });
} }
if (nameTreeRef) { if (nameTreeRef) {
@ -3588,7 +3588,7 @@ var Catalog = (function() {
} }
var names = obj.get('Names'); var names = obj.get('Names');
for (i = 0, n = names.length; i < n; i += 2) { for (i = 0, n = names.length; i < n; i += 2) {
dests[names[i]] = fetchDestination(names[i + 1]); dests[names[i]] = fetchDestination(xref, names[i + 1]);
} }
} }
} }