mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Remove some unused variables from src/
Only obviously useless, local variables have been removed.
This commit is contained in:
parent
d7dfa447cd
commit
2e97c0d085
17 changed files with 9 additions and 111 deletions
|
@ -99,46 +99,6 @@ var bidi = PDFJS.bidi = (function bidiClosure() {
|
|||
}
|
||||
}
|
||||
|
||||
function mirrorGlyphs(c) {
|
||||
/*
|
||||
# BidiMirroring-1.txt
|
||||
0028; 0029 # LEFT PARENTHESIS
|
||||
0029; 0028 # RIGHT PARENTHESIS
|
||||
003C; 003E # LESS-THAN SIGN
|
||||
003E; 003C # GREATER-THAN SIGN
|
||||
005B; 005D # LEFT SQUARE BRACKET
|
||||
005D; 005B # RIGHT SQUARE BRACKET
|
||||
007B; 007D # LEFT CURLY BRACKET
|
||||
007D; 007B # RIGHT CURLY BRACKET
|
||||
00AB; 00BB # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
00BB; 00AB # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
*/
|
||||
switch (c) {
|
||||
case '(':
|
||||
return ')';
|
||||
case ')':
|
||||
return '(';
|
||||
case '<':
|
||||
return '>';
|
||||
case '>':
|
||||
return '<';
|
||||
case ']':
|
||||
return '[';
|
||||
case '[':
|
||||
return ']';
|
||||
case '}':
|
||||
return '{';
|
||||
case '{':
|
||||
return '}';
|
||||
case '\u00AB':
|
||||
return '\u00BB';
|
||||
case '\u00BB':
|
||||
return '\u00AB';
|
||||
default:
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
function createBidiText(str, isLTR, vertical) {
|
||||
return {
|
||||
str: str,
|
||||
|
|
|
@ -237,7 +237,6 @@ var ChunkedStream = (function ChunkedStreamClosure() {
|
|||
var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
|
||||
|
||||
function ChunkedStreamManager(length, chunkSize, url, args) {
|
||||
var self = this;
|
||||
this.stream = new ChunkedStream(length, chunkSize, this);
|
||||
this.length = length;
|
||||
this.chunkSize = chunkSize;
|
||||
|
|
|
@ -509,7 +509,6 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
|
||||
var self = this;
|
||||
var xref = this.xref;
|
||||
var handler = this.handler;
|
||||
var imageCache = {};
|
||||
|
||||
operatorList = (operatorList || new OperatorList());
|
||||
|
@ -520,7 +519,6 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
var stateManager = new StateManager(initialState || new EvalState());
|
||||
var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager);
|
||||
|
||||
var promise = new LegacyPromise();
|
||||
var operation, i, ii;
|
||||
while ((operation = preprocessor.read())) {
|
||||
var args = operation.args;
|
||||
|
@ -706,7 +704,6 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
var xobjsCache = {};
|
||||
|
||||
var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager);
|
||||
var res = resources;
|
||||
|
||||
var operation;
|
||||
var textState;
|
||||
|
@ -1091,7 +1088,6 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
|
||||
readToUnicode: function PartialEvaluator_readToUnicode(toUnicode) {
|
||||
var cmapObj = toUnicode;
|
||||
var charToUnicode = [];
|
||||
if (isName(cmapObj)) {
|
||||
return CMapFactory.create(cmapObj).map;
|
||||
} else if (isStream(cmapObj)) {
|
||||
|
|
|
@ -148,10 +148,6 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
|
|||
|
||||
var i = 0;
|
||||
var numberOfContours = ((code[i] << 24) | (code[i + 1] << 16)) >> 16;
|
||||
var xMin = ((code[i + 2] << 24) | (code[i + 3] << 16)) >> 16;
|
||||
var yMin = ((code[i + 4] << 24) | (code[i + 5] << 16)) >> 16;
|
||||
var xMax = ((code[i + 6] << 24) | (code[i + 7] << 16)) >> 16;
|
||||
var yMax = ((code[i + 8] << 24) | (code[i + 9] << 16)) >> 16;
|
||||
var flags;
|
||||
var x = 0, y = 0;
|
||||
i += 10;
|
||||
|
|
|
@ -2423,7 +2423,6 @@ var Font = (function FontClosure() {
|
|||
var isIdentityUnicode = properties.isIdentityUnicode;
|
||||
var newMap = Object.create(null);
|
||||
var toFontChar = [];
|
||||
var usedCharCodes = [];
|
||||
var usedFontCharCodes = [];
|
||||
var nextAvailableFontCharCode = PRIVATE_USE_OFFSET_START;
|
||||
for (var originalCharCode in charCodeToGlyphId) {
|
||||
|
@ -3049,8 +3048,6 @@ var Font = (function FontClosure() {
|
|||
var firstCode = font.getUint16();
|
||||
var entryCount = font.getUint16();
|
||||
|
||||
var glyphs = [];
|
||||
var ids = [];
|
||||
for (j = 0; j < entryCount; j++) {
|
||||
glyphId = font.getUint16();
|
||||
var charCode = firstCode + j;
|
||||
|
@ -3438,7 +3435,6 @@ var Font = (function FontClosure() {
|
|||
}
|
||||
font.pos = pos;
|
||||
var nameIndex = record.name;
|
||||
var encoding = record.encoding ? 1 : 0;
|
||||
if (record.encoding) {
|
||||
// unicode
|
||||
var str = '';
|
||||
|
@ -4030,8 +4026,6 @@ var Font = (function FontClosure() {
|
|||
// to write the table entry information about a table and another offset
|
||||
// representing the offset where to draw the actual data of a particular
|
||||
// table
|
||||
var REQ_TABLES_CNT = 9;
|
||||
|
||||
var otf = {
|
||||
file: '',
|
||||
virtualOffset: 9 * (4 * 4)
|
||||
|
@ -5812,7 +5806,6 @@ var CFFParser = (function CFFParserClosure() {
|
|||
var bytes = this.bytes;
|
||||
var count = (bytes[pos++] << 8) | bytes[pos++];
|
||||
var offsets = [];
|
||||
var start = pos;
|
||||
var end = pos;
|
||||
var i, ii;
|
||||
|
||||
|
@ -5875,8 +5868,6 @@ var CFFParser = (function CFFParserClosure() {
|
|||
},
|
||||
createDict: function CFFParser_createDict(Type, dict, strings) {
|
||||
var cffDict = new Type(strings);
|
||||
var types = cffDict.types;
|
||||
|
||||
for (var i = 0, ii = dict.length; i < ii; ++i) {
|
||||
var pair = dict[i];
|
||||
var key = pair[0];
|
||||
|
@ -6444,11 +6435,6 @@ var CFFCharsetPredefinedTypes = {
|
|||
EXPERT: 1,
|
||||
EXPERT_SUBSET: 2
|
||||
};
|
||||
var CFFCharsetEmbeddedTypes = {
|
||||
FORMAT0: 0,
|
||||
FORMAT1: 1,
|
||||
FORMAT2: 2
|
||||
};
|
||||
var CFFCharset = (function CFFCharsetClosure() {
|
||||
function CFFCharset(predefined, format, charset, raw) {
|
||||
this.predefined = predefined;
|
||||
|
@ -6459,14 +6445,6 @@ var CFFCharset = (function CFFCharsetClosure() {
|
|||
return CFFCharset;
|
||||
})();
|
||||
|
||||
var CFFEncodingPredefinedTypes = {
|
||||
STANDARD: 0,
|
||||
EXPERT: 1
|
||||
};
|
||||
var CFFCharsetEmbeddedTypes = {
|
||||
FORMAT0: 0,
|
||||
FORMAT1: 1
|
||||
};
|
||||
var CFFEncoding = (function CFFEncodingClosure() {
|
||||
function CFFEncoding(predefined, format, encoding, raw) {
|
||||
this.predefined = predefined;
|
||||
|
@ -6930,7 +6908,6 @@ var CFFCompiler = (function CFFCompilerClosure() {
|
|||
relativeOffset += objects[i].length;
|
||||
}
|
||||
}
|
||||
var offset = data.length;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
// Notify the tracker where the object will be offset in the data.
|
||||
|
|
|
@ -265,7 +265,6 @@ var PDFImage = (function PDFImageClosure() {
|
|||
},
|
||||
decodeBuffer: function PDFImage_decodeBuffer(buffer) {
|
||||
var bpc = this.bpc;
|
||||
var decodeMap = this.decode;
|
||||
var numComps = this.numComps;
|
||||
|
||||
var decodeAddends = this.decodeAddends;
|
||||
|
|
|
@ -428,7 +428,6 @@ var JpxImage = (function JpxImageClosure() {
|
|||
var componentsCount = siz.Csiz;
|
||||
for (var i = 0, ii = componentsCount; i < ii; i++) {
|
||||
var component = components[i];
|
||||
var tileComponents = [];
|
||||
for (var j = 0, jj = tiles.length; j < jj; j++) {
|
||||
var tileComponent = {};
|
||||
tile = tiles[j];
|
||||
|
@ -497,7 +496,7 @@ var JpxImage = (function JpxImageClosure() {
|
|||
var precinctParameters = subband.resolution.precinctParameters;
|
||||
var codeblocks = [];
|
||||
var precincts = [];
|
||||
var i, ii, j, codeblock, precinctNumber;
|
||||
var i, j, codeblock, precinctNumber;
|
||||
for (j = cby0; j < cby1; j++) {
|
||||
for (i = cbx0; i < cbx1; i++) {
|
||||
codeblock = {
|
||||
|
@ -522,8 +521,6 @@ var JpxImage = (function JpxImageClosure() {
|
|||
codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1);
|
||||
codeblock.precinctNumber = precinctNumber;
|
||||
codeblock.subbandType = subband.type;
|
||||
var coefficientsLength = (codeblock.tbx1_ - codeblock.tbx0_) *
|
||||
(codeblock.tby1_ - codeblock.tby0_);
|
||||
codeblock.Lblock = 3;
|
||||
codeblocks.push(codeblock);
|
||||
// building precinct for the sub-band
|
||||
|
@ -742,7 +739,6 @@ var JpxImage = (function JpxImageClosure() {
|
|||
}
|
||||
// Generate the packets sequence
|
||||
var progressionOrder = tile.codingStyleDefaultParameters.progressionOrder;
|
||||
var packetsIterator;
|
||||
switch (progressionOrder) {
|
||||
case 0:
|
||||
tile.packetsIterator =
|
||||
|
@ -966,7 +962,7 @@ var JpxImage = (function JpxImageClosure() {
|
|||
}
|
||||
|
||||
var offset = (codeblock.tbx0_ - x0) + (codeblock.tby0_ - y0) * width;
|
||||
var n, nb, correction, position = 0;
|
||||
var n, nb, position = 0;
|
||||
var irreversible = !reversible;
|
||||
var sign = bitModel.coefficentsSign;
|
||||
var magnitude = bitModel.coefficentsMagnitude;
|
||||
|
@ -1077,7 +1073,7 @@ var JpxImage = (function JpxImageClosure() {
|
|||
|
||||
// Section G.2.2 Inverse multi component transform
|
||||
var y0items, y1items, y2items, j, jj, y0, y1, y2;
|
||||
var component, offset, tileImage, items;
|
||||
var component, tileImage, items;
|
||||
if (tile.codingStyleDefaultParameters.multipleComponentTransform) {
|
||||
var component0 = tile.components[0];
|
||||
if (!component0.codingStyleParameters.reversibleTransformation) {
|
||||
|
@ -1130,7 +1126,6 @@ var JpxImage = (function JpxImageClosure() {
|
|||
var siz = context.SIZ;
|
||||
var componentsCount = siz.Csiz;
|
||||
var tile = context.tiles[tileIndex];
|
||||
var resultTiles = [];
|
||||
for (var c = 0; c < componentsCount; c++) {
|
||||
var component = tile.components[c];
|
||||
var qcdOrQcc = (c in context.currentTile.QCC ?
|
||||
|
@ -1393,7 +1388,6 @@ var JpxImage = (function JpxImageClosure() {
|
|||
var width = this.width, height = this.height;
|
||||
var coefficentsMagnitude = this.coefficentsMagnitude;
|
||||
var coefficentsSign = this.coefficentsSign;
|
||||
var contextLabels = this.contextLabels;
|
||||
var neighborsSignificance = this.neighborsSignificance;
|
||||
var processingFlags = this.processingFlags;
|
||||
var contexts = this.contexts;
|
||||
|
@ -1531,7 +1525,6 @@ var JpxImage = (function JpxImageClosure() {
|
|||
var decoder = this.decoder;
|
||||
var width = this.width, height = this.height;
|
||||
var neighborsSignificance = this.neighborsSignificance;
|
||||
var significanceState = this.significanceState;
|
||||
var coefficentsMagnitude = this.coefficentsMagnitude;
|
||||
var coefficentsSign = this.coefficentsSign;
|
||||
var contexts = this.contexts;
|
||||
|
@ -1795,7 +1788,7 @@ var JpxImage = (function JpxImageClosure() {
|
|||
var delta = 0.443506852043971;
|
||||
var K = 1.230174104914001;
|
||||
var K_ = 1 / K;
|
||||
var j, n, nn;
|
||||
var j, n;
|
||||
|
||||
// step 1 is combined with step 3
|
||||
|
||||
|
|
|
@ -940,8 +940,6 @@ var XRef = (function XRefClosure() {
|
|||
var buffer = stream.getBytes();
|
||||
var position = stream.start, length = buffer.length;
|
||||
var trailers = [], xrefStms = [];
|
||||
var state = 0;
|
||||
var currentToken;
|
||||
while (position < length) {
|
||||
var ch = buffer[position];
|
||||
if (ch === 32 || ch === 9 || ch === 13 || ch === 10) {
|
||||
|
|
|
@ -503,7 +503,6 @@ var Lexer = (function LexerClosure() {
|
|||
} else if (ch === 0x45 || ch === 0x65) { // 'E', 'e'
|
||||
// 'E' can be either a scientific notation or the beginning of a new
|
||||
// operator
|
||||
var hasE = true;
|
||||
ch = this.peekChar();
|
||||
if (ch === 0x2B || ch === 0x2D) { // '+', '-'
|
||||
powerValueSign = (ch === 0x2D) ? -1 : 1;
|
||||
|
@ -781,7 +780,6 @@ var Lexer = (function LexerClosure() {
|
|||
return Cmd.get(str);
|
||||
},
|
||||
skipToNextLine: function Lexer_skipToNextLine() {
|
||||
var stream = this.stream;
|
||||
var ch = this.currentChar;
|
||||
while (ch >= 0) {
|
||||
if (ch === 0x0D) { // CR
|
||||
|
|
|
@ -361,7 +361,6 @@ Shadings.Mesh = (function MeshClosure() {
|
|||
function decodeType5Shading(mesh, reader, verticesPerRow) {
|
||||
var coords = mesh.coords;
|
||||
var colors = mesh.colors;
|
||||
var operators = [];
|
||||
var ps = []; // not maintaining cs since that will match ps
|
||||
while (reader.hasData) {
|
||||
var coord = reader.readCoordinate();
|
||||
|
|
|
@ -143,7 +143,6 @@ var PostScriptLexer = (function PostScriptLexerClosure() {
|
|||
return (this.currentChar = this.stream.getByte());
|
||||
},
|
||||
getToken: function PostScriptLexer_getToken() {
|
||||
var s = '';
|
||||
var comment = false;
|
||||
var ch = this.currentChar;
|
||||
|
||||
|
|
|
@ -2212,7 +2212,6 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
|
|||
|
||||
var code = 0;
|
||||
var p;
|
||||
var n;
|
||||
if (this.eoblock) {
|
||||
code = this.lookBits(12);
|
||||
if (code == EOF) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue