]> git.parisson.com Git - pdf.js.git/commitdiff
Address comments for xref bug.
authorKalervo Kujala <kkujala@>
Sat, 3 Sep 2011 19:28:45 +0000 (22:28 +0300)
committerKalervo Kujala <kkujala@>
Sat, 3 Sep 2011 19:28:45 +0000 (22:28 +0300)
pdf.js

diff --git a/pdf.js b/pdf.js
index cf9615875b639b9dca593a7a20e5b643ca539224..8303bb650dd9df4ac93e8d6911a3b4a3e50f2165 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -3546,8 +3546,8 @@ var Catalog = (function() {
       }
     },
     get destinations() {
-      function fetchDestination(ref) {
-        var dest = this.xref.fetchIfRef(ref);
+      function fetchDestination(xref, ref) {
+        var dest = xref.fetchIfRef(ref);
         return IsDict(dest) ? dest.get('D') : dest;
       }
 
@@ -3564,7 +3564,7 @@ var Catalog = (function() {
         obj = xref.fetchIfRef(nameDictionaryRef);
         obj.forEach(function(key, value) {
           if (!value) return;
-          dests[key] = fetchDestination(value);
+          dests[key] = fetchDestination(xref, value);
         });
       }
       if (nameTreeRef) {
@@ -3588,7 +3588,7 @@ var Catalog = (function() {
           }
           var names = obj.get('Names');
           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]);
           }
         }
       }