Skip to content

Commit

Permalink
Merge pull request #6208 from Snuffleupagus/issue-6204
Browse files Browse the repository at this point in the history
Fetch all indirect objects (i.e. `Ref`s) in `NameTree_getAll` and `NameTree_get` (issue 6204)
  • Loading branch information
timvandermeij committed Jul 14, 2015
2 parents 76d225d + 28f40b1 commit 2817f00
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/obj.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
}
Expand Down Expand Up @@ -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]);
Expand All @@ -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]);
Expand Down

0 comments on commit 2817f00

Please sign in to comment.