From 76564085792f48e7fac285a73ecb57597bdbf134 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Thu, 8 May 2014 22:42:47 +0200 Subject: [PATCH 1/2] 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 269254a31..3d6510f87 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); } }); From a762c9f3c6b19251d2d7211cfba3c1c06bf07bf5 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Thu, 8 May 2014 22:45:30 +0200 Subject: [PATCH 2/2] Removing old TODOs and comments from jasmine.js --- external/jasmine/jasmine.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/external/jasmine/jasmine.js b/external/jasmine/jasmine.js index 8bba9262d..adf9859b4 100644 --- a/external/jasmine/jasmine.js +++ b/external/jasmine/jasmine.js @@ -458,8 +458,6 @@ if (isCommonJS) exports.spyOn = spyOn; /** * Creates a Jasmine spec that will be added to the current suite. * - * // TODO: pending tests - * * @example * it('should be true', function() { * expect(true).toEqual(true); @@ -563,11 +561,6 @@ if (isCommonJS) exports.afterEach = afterEach; * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization * of setup in some tests. * - * @example - * // TODO: a simple suite - * - * // TODO: a simple suite with a nested describe block - * * @param {String} description A string, usually the class under test. * @param {Function} specDefinitions function that defines several specs. */