Merge pull request #6208 from Snuffleupagus/issue-6204

Fetch all indirect objects (i.e. `Ref`s) in `NameTree_getAll` and `NameTree_get` (issue 6204)
This commit is contained in:
Tim van der Meij 2015-07-14 22:03:03 +02:00
commit 2817f008c3

View File

@ -1408,7 +1408,7 @@ var NameTree = (function NameTreeClosure() {
var names = obj.get('Names');
if (names) {
for (i = 0, n = names.length; i < n; i += 2) {
dict[names[i]] = xref.fetchIfRef(names[i + 1]);
dict[xref.fetchIfRef(names[i])] = xref.fetchIfRef(names[i + 1]);
}
}
}
@ -1447,9 +1447,9 @@ var NameTree = (function NameTreeClosure() {
var kid = xref.fetchIfRef(kids[m]);
var limits = kid.get('Limits');
if (destinationId < limits[0]) {
if (destinationId < xref.fetchIfRef(limits[0])) {
r = m - 1;
} else if (destinationId > limits[1]) {
} else if (destinationId > xref.fetchIfRef(limits[1])) {
l = m + 1;
} else {
kidsOrNames = xref.fetchIfRef(kids[m]);
@ -1473,9 +1473,9 @@ var NameTree = (function NameTreeClosure() {
// Check only even indices (0, 2, 4, ...) because the
// odd indices contain the actual D array.
m = (l + r) & ~1;
if (destinationId < names[m]) {
if (destinationId < xref.fetchIfRef(names[m])) {
r = m - 2;
} else if (destinationId > names[m]) {
} else if (destinationId > xref.fetchIfRef(names[m])) {
l = m + 2;
} else {
return xref.fetchIfRef(names[m + 1]);