Skip to content

Commit 598421b

Browse files
Merge pull request #16856 from Snuffleupagus/limit-lineEndings
Exclude `lineEndings`, in Annotation-data, in MOZCENTRAL builds (PR 14899 follow-up)
2 parents 62a294b + cd181eb commit 598421b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/core/annotation.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,9 @@ class Annotation {
848848
* @param {Array} lineEndings - The line endings array.
849849
*/
850850
setLineEndings(lineEndings) {
851+
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
852+
throw new Error("Not implemented: setLineEndings");
853+
}
851854
this.lineEndings = ["None", "None"]; // The default values.
852855

853856
if (Array.isArray(lineEndings) && lineEndings.length === 2) {
@@ -3932,8 +3935,10 @@ class LineAnnotation extends MarkupAnnotation {
39323935
const lineCoordinates = dict.getArray("L");
39333936
this.data.lineCoordinates = Util.normalizeRect(lineCoordinates);
39343937

3935-
this.setLineEndings(dict.getArray("LE"));
3936-
this.data.lineEndings = this.lineEndings;
3938+
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
3939+
this.setLineEndings(dict.getArray("LE"));
3940+
this.data.lineEndings = this.lineEndings;
3941+
}
39373942

39383943
if (!this.appearance) {
39393944
// The default stroke color is black.
@@ -4107,7 +4112,10 @@ class PolylineAnnotation extends MarkupAnnotation {
41074112
this.data.hasOwnCanvas = this.data.noRotate;
41084113
this.data.vertices = [];
41094114

4110-
if (!(this instanceof PolygonAnnotation)) {
4115+
if (
4116+
(typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) &&
4117+
!(this instanceof PolygonAnnotation)
4118+
) {
41114119
// Only meaningful for polyline annotations.
41124120
this.setLineEndings(dict.getArray("LE"));
41134121
this.data.lineEndings = this.lineEndings;

0 commit comments

Comments
 (0)