Merge pull request #4759 from timvandermeij/old-code
Refactoring annotation.js and removing old TODOs/comments
This commit is contained in:
commit
12d9022d36
7
external/jasmine/jasmine.js
vendored
7
external/jasmine/jasmine.js
vendored
@ -458,8 +458,6 @@ if (isCommonJS) exports.spyOn = spyOn;
|
|||||||
/**
|
/**
|
||||||
* Creates a Jasmine spec that will be added to the current suite.
|
* Creates a Jasmine spec that will be added to the current suite.
|
||||||
*
|
*
|
||||||
* // TODO: pending tests
|
|
||||||
*
|
|
||||||
* @example
|
* @example
|
||||||
* it('should be true', function() {
|
* it('should be true', function() {
|
||||||
* expect(true).toEqual(true);
|
* 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
|
* are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization
|
||||||
* of setup in some tests.
|
* 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 {String} description A string, usually the class under test.
|
||||||
* @param {Function} specDefinitions function that defines several specs.
|
* @param {Function} specDefinitions function that defines several specs.
|
||||||
*/
|
*/
|
||||||
|
@ -501,44 +501,12 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() {
|
|||||||
|
|
||||||
// Even if there is an appearance stream, ignore it. This is the
|
// Even if there is an appearance stream, ignore it. This is the
|
||||||
// behaviour used by Adobe Reader.
|
// behaviour used by Adobe Reader.
|
||||||
|
if (!data.defaultAppearance) {
|
||||||
var defaultAppearance = data.defaultAppearance;
|
|
||||||
if (!defaultAppearance) {
|
|
||||||
return Promise.resolve(opList);
|
return Promise.resolve(opList);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include any font resources found in the default appearance
|
var stream = new Stream(stringToBytes(data.defaultAppearance));
|
||||||
|
|
||||||
var stream = new Stream(stringToBytes(defaultAppearance));
|
|
||||||
evaluator.getOperatorList(stream, this.fieldResources, opList);
|
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);
|
return Promise.resolve(opList);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user