Skip to content

Commit

Permalink
[pdf] Disable stream appearance if annots in changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
KhromovNikita committed Feb 7, 2024
1 parent 5860294 commit c5e0fdf
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 21 deletions.
9 changes: 1 addition & 8 deletions pdf/src/annotations/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@

if (oViewer.IsOpenAnnotsInProgress == false) {
this._wasChanged = isChanged;
this.SetDrawFromStream(!isChanged);
}
};
CAnnotationBase.prototype.IsChanged = function() {
Expand Down Expand Up @@ -531,9 +532,6 @@
this._origRect[3] = this._rect[3] / nScaleY;

this.SetWasChanged(true);
if (oViewer.IsOpenAnnotsInProgress == false) {
this.SetDrawFromStream(false);
}
};
CAnnotationBase.prototype.IsUseInDocument = function() {
if (this.GetDocument().annots.indexOf(this) == -1)
Expand Down Expand Up @@ -937,13 +935,8 @@
};

CAnnotationBase.prototype.SetStrokeColor = function(aColor) {
let oViewer = editor.getDocumentRenderer();

this._strokeColor = aColor;
this.SetWasChanged(true);
if (oViewer.IsOpenAnnotsInProgress == false) {
this.SetDrawFromStream(false);
}
};
CAnnotationBase.prototype.GetStrokeColor = function() {
return this._strokeColor;
Expand Down
1 change: 0 additions & 1 deletion pdf/src/annotations/circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@
this.recalcGeometry();
this.AddToRedraw();
this.SetWasChanged(true);
this.SetDrawFromStream(false);
};
CAnnotationCircle.prototype.SetRectangleDiff = function(aDiff) {
let oDoc = this.GetDocument();
Expand Down
3 changes: 0 additions & 3 deletions pdf/src/annotations/freeText.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@

return calculateBoundingRectangle(oLine, oShapeEndSize);
};
CAnnotationFreeText.prototype.IsNeedDrawFromStream = function() {
return false;
};

CAnnotationFreeText.prototype.IsFreeText = function() {
return true;
Expand Down
1 change: 0 additions & 1 deletion pdf/src/annotations/ink.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@
this.RefillGeometry(this.spPr.geometry, [aRect[0] * g_dKoef_pix_to_mm, aRect[1] * g_dKoef_pix_to_mm, aRect[2] * g_dKoef_pix_to_mm, aRect[3] * g_dKoef_pix_to_mm]);

this.SetWasChanged(true);
this.SetDrawFromStream(false);
};
CAnnotationInk.prototype.SetFlipV = function(bFlip) {
let oDoc = this.GetDocument();
Expand Down
1 change: 0 additions & 1 deletion pdf/src/annotations/line.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@

this.AddToRedraw();
this.SetWasChanged(true);
this.SetDrawFromStream(false);
};
CAnnotationLine.prototype.SetStrokeColor = function(aColor) {
this._strokeColor = aColor;
Expand Down
1 change: 0 additions & 1 deletion pdf/src/annotations/polyLine.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@

this.AddToRedraw();
this.SetWasChanged(true);
this.SetDrawFromStream(false);
};
CAnnotationPolyLine.prototype.LazyCopy = function() {
let oDoc = this.GetDocument();
Expand Down
1 change: 0 additions & 1 deletion pdf/src/annotations/polygon.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@

this.AddToRedraw();
this.SetWasChanged(true);
this.SetDrawFromStream(false);
};
CAnnotationPolygon.prototype.LazyCopy = function() {
let oDoc = this.GetDocument();
Expand Down
1 change: 0 additions & 1 deletion pdf/src/annotations/square.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@
this.recalcGeometry();
this.AddToRedraw();
this.SetWasChanged(true);
this.SetDrawFromStream(false);
};
CAnnotationSquare.prototype.SetRectangleDiff = function(aDiff) {
let oDoc = this.GetDocument();
Expand Down
2 changes: 1 addition & 1 deletion pdf/src/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -2496,7 +2496,7 @@ var CPresentation = CPresentation || function(){};

this.defaultFontsLoaded = 0;
let _t = this;
this.fontLoader.LoadDocumentFonts2([{name : "Arial"}],
this.fontLoader.LoadDocumentFonts2([{name : AscPDF.DEFAULT_FIELD_FONT}],
Asc.c_oAscAsyncActionType.Empty,
function()
{
Expand Down
4 changes: 1 addition & 3 deletions pdf/src/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1260,9 +1260,7 @@
this.doc.FillButtonsIconsOnOpen();
};
this.openAnnots = function() {
let oThis = this;

this.doc.checkDefaultFieldFonts();
// this.doc.checkDefaultFieldFonts();
let oAnnotsMap = {};
let oDoc = this.getPDFDoc();
let aAnnotsInfo = this.file.nativeFile["getAnnotationsInfo"]();
Expand Down

0 comments on commit c5e0fdf

Please sign in to comment.