[Pkg-javascript-commits] [pdf.js] 101/210: Refactoring Util.inherit.getOperatorList in annotation.js

David Prévot taffit at moszumanska.debian.org
Thu Jun 5 14:21:06 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch upstream
in repository pdf.js.

commit 76564085792f48e7fac285a73ecb57597bdbf134
Author: Tim van der Meij <timvandermeij at gmail.com>
Date:   Thu May 8 22:42:47 2014 +0200

    Refactoring Util.inherit.getOperatorList in annotation.js
---
 src/shared/annotation.js | 36 ++----------------------------------
 1 file changed, 2 insertions(+), 34 deletions(-)

diff --git a/src/shared/annotation.js b/src/shared/annotation.js
index 269254a..3d6510f 100644
--- a/src/shared/annotation.js
+++ b/src/shared/annotation.js
@@ -501,44 +501,12 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() {
 
       // Even if there is an appearance stream, ignore it. This is the
       // behaviour used by Adobe Reader.
-
-      var defaultAppearance = data.defaultAppearance;
-      if (!defaultAppearance) {
+      if (!data.defaultAppearance) {
         return Promise.resolve(opList);
       }
 
-      // Include any font resources found in the default appearance
-
-      var stream = new Stream(stringToBytes(defaultAppearance));
+      var stream = new Stream(stringToBytes(data.defaultAppearance));
       evaluator.getOperatorList(stream, this.fieldResources, opList);
-      var appearanceFnArray = opList.fnArray;
-      var appearanceArgsArray = opList.argsArray;
-      var fnArray = [];
-
-      // TODO(mack): Add support for stroke color
-      data.rgb = [0, 0, 0];
-      // TODO THIS DOESN'T MAKE ANY SENSE SINCE THE fnArray IS EMPTY!
-      for (var i = 0, n = fnArray.length; i < n; ++i) {
-        var fnId = appearanceFnArray[i];
-        var args = appearanceArgsArray[i];
-
-        if (fnId === OPS.setFont) {
-          data.fontRefName = args[0];
-          var size = args[1];
-          if (size < 0) {
-            data.fontDirection = -1;
-            data.fontSize = -size;
-          } else {
-            data.fontDirection = 1;
-            data.fontSize = size;
-          }
-        } else if (fnId === OPS.setFillRGBColor) {
-          data.rgb = args;
-        } else if (fnId === OPS.setFillGray) {
-          var rgbValue = args[0] * 255;
-          data.rgb = [rgbValue, rgbValue, rgbValue];
-        }
-      }
       return Promise.resolve(opList);
     }
   });

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list