Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring annotation.js and removing old TODOs/comments #4759

Merged
merged 2 commits into from
May 9, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions external/jasmine/jasmine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.
*/
Expand Down
36 changes: 2 additions & 34 deletions src/shared/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
Expand Down