Skip to content

Commit

Permalink
Merge pull request #16856 from Snuffleupagus/limit-lineEndings
Browse files Browse the repository at this point in the history
Exclude `lineEndings`, in Annotation-data, in MOZCENTRAL builds (PR 14899 follow-up)
  • Loading branch information
Snuffleupagus authored Aug 24, 2023
2 parents 62a294b + cd181eb commit 598421b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/core/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,9 @@ class Annotation {
* @param {Array} lineEndings - The line endings array.
*/
setLineEndings(lineEndings) {
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
throw new Error("Not implemented: setLineEndings");
}
this.lineEndings = ["None", "None"]; // The default values.

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

this.setLineEndings(dict.getArray("LE"));
this.data.lineEndings = this.lineEndings;
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
this.setLineEndings(dict.getArray("LE"));
this.data.lineEndings = this.lineEndings;
}

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

if (!(this instanceof PolygonAnnotation)) {
if (
(typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) &&
!(this instanceof PolygonAnnotation)
) {
// Only meaningful for polyline annotations.
this.setLineEndings(dict.getArray("LE"));
this.data.lineEndings = this.lineEndings;
Expand Down

0 comments on commit 598421b

Please sign in to comment.