]> git.parisson.com Git - pdf.js.git/commitdiff
Merge remote-tracking branch 'mozilla/master' into mergexref-1
authorYury Delendik <ydelendik@mozilla.com>
Thu, 5 Apr 2012 15:03:49 +0000 (10:03 -0500)
committerYury Delendik <ydelendik@mozilla.com>
Thu, 5 Apr 2012 15:03:49 +0000 (10:03 -0500)
Conflicts:
src/core.js
src/evaluator.js
src/obj.js

1  2 
src/colorspace.js
src/core.js
src/evaluator.js
src/function.js
src/image.js
src/obj.js
src/parser.js
src/pattern.js

index 9b89d7b5a077fc75455adb6a56e4e6f1bac7864b,6e8a77e64b992994548833aa1f2e66a6c339410e..8d8290109decd1ca1868c5852db7338161a27601
@@@ -68,9 -68,9 +68,9 @@@ var ColorSpace = (function ColorSpaceCl
      return null;
    };
  
-   ColorSpace.parseToIR = function colorSpaceParseToIR(cs, xref, res) {
+   ColorSpace.parseToIR = function ColorSpace_parseToIR(cs, xref, res) {
      if (isName(cs)) {
 -      var colorSpaces = xref.fetchIfRef(res.get('ColorSpace'));
 +      var colorSpaces = res.get('ColorSpace');
        if (isDict(colorSpaces)) {
          var refcs = colorSpaces.get(cs.name);
          if (refcs)
diff --cc src/core.js
index bf0d2bbfe9a195894bfae55d7186706809966d95,a90974386fccb1558b37d86dbf2bd9ea6b712eb4..10ae7d0853cd2c6275a1aeca28ea8b18d37f463f
@@@ -72,10 -72,10 +72,10 @@@ var Page = (function PageClosure() 
    }
  
    Page.prototype = {
-     getPageProp: function pageGetPageProp(key) {
+     getPageProp: function Page_getPageProp(key) {
 -      return this.xref.fetchIfRef(this.pageDict.get(key));
 +      return this.pageDict.get(key);
      },
-     inheritPageProp: function pageInheritPageProp(key) {
+     inheritPageProp: function Page_inheritPageProp(key) {
        var dict = this.pageDict;
        var obj = dict.get(key);
        while (obj === undefined) {
@@@ -595,10 -594,10 +595,10 @@@ var PDFDocModel = (function PDFDocModel
        // shadow the prototype getter
        return shadow(this, 'numPages', num);
      },
-     getDocumentInfo: function pdfDocGetDocumentInfo() {
+     getDocumentInfo: function PDFDocModel_getDocumentInfo() {
        var info;
        if (this.xref.trailer.has('Info'))
 -        info = this.xref.fetch(this.xref.trailer.get('Info'));
 +        info = this.xref.trailer.get('Info');
  
        return shadow(this, 'getDocumentInfo', info);
      },
index 8db082d594251c202e030e0e6af24e4e132fdf94,10a945022ecf06f7023d0b9813d03b1884398ca4..203247bb86dfc1858432675d42308af1a3e03600
@@@ -518,9 -523,8 +520,8 @@@ var PartialEvaluator = (function Partia
        properties.hasEncoding = hasEncoding;
      },
  
-     readToUnicode:
-       function partialEvaluatorReadToUnicode(toUnicode, xref) {
+     readToUnicode: function PartialEvaluator_readToUnicode(toUnicode, xref) {
 -      var cmapObj = xref.fetchIfRef(toUnicode);
 +      var cmapObj = toUnicode;
        var charToUnicode = [];
        if (isName(cmapObj)) {
          var isIdentityMap = cmapObj.name.substr(0, 9) == 'Identity-';
diff --cc src/function.js
Simple merge
diff --cc src/image.js
Simple merge
diff --cc src/obj.js
index 675db3f9fec83b3262a47413d9ced07f2ed10a9f,b6139fb8c0ab0366bd361fac30665ffc0e5d7071..3baf98f2400fb66c3822cb992e539ec67f201ba8
@@@ -42,34 -39,21 +42,34 @@@ var Dict = (function DictClosure() 
    }
  
    Dict.prototype = {
-     get: function dictGet(key1, key2, key3) {
 +    // automatically dereferences Ref objects
+     get: function Dict_get(key1, key2, key3) {
        var value;
 +      var xref = this.xref;
        if (typeof (value = this.map[key1]) != 'undefined' || key1 in this.map ||
            typeof key2 == 'undefined') {
 -        return value;
 +        return xref ? this.xref.fetchIfRef(value) : value;
        }
        if (typeof (value = this.map[key2]) != 'undefined' || key2 in this.map ||
            typeof key3 == 'undefined') {
 -        return value;
 +        return xref ? this.xref.fetchIfRef(value) : value;
        }
 -
 -      return this.map[key3] || null;
 +      value = this.map[key3] || null;
 +      return xref ? this.xref.fetchIfRef(value) : value;
 +    },
 +    // no dereferencing
-     getRaw: function dictGetRaw(key) {
++    getRaw: function Dict_getRaw(key) {
 +      return this.map[key];
 +    },
 +    // creates new map and dereferences all Refs
-     getAll: function dictGetAll() {
++    getAll: function Dict_getAll() {
 +      var all = {};
 +      for (var key in this.map)
 +        all[key] = this.get(key);
 +      return all;
      },
  
-     set: function dictSet(key, value) {
+     set: function Dict_set(key, value) {
        this.map[key] = value;
      },
  
@@@ -77,9 -61,9 +77,9 @@@
        return key in this.map;
      },
  
-     forEach: function dictForEach(callback) {
+     forEach: function Dict_forEach(callback) {
        for (var key in this.map) {
 -        callback(key, this.map[key]);
 +        callback(key, this.get(key));
        }
      }
    };
@@@ -608,8 -595,7 +608,8 @@@ var XRef = (function XRefClosure() 
          return obj;
        return this.fetch(obj);
      },
-     fetch: function xRefFetch(ref, suppressEncryption) {
+     fetch: function XRef_fetch(ref, suppressEncryption) {
 +      assertWellFormed(isRef(ref), 'ref object is not a reference');
        var num = ref.num;
        if (num in this.cache)
          return this.cache[num];
        }
        return e;
      },
-     getCatalogObj: function xRefGetCatalogObj() {
-       return this.root;
+     getCatalogObj: function XRef_getCatalogObj() {
 -      return this.fetch(this.root);
++      return this.this.root;
      }
    };
  
diff --cc src/parser.js
Simple merge
diff --cc src/pattern.js
Simple merge