Skip to content

Commit

Permalink
Merge branch 'release/v8.2.0' into fix/math-get-text
Browse files Browse the repository at this point in the history
  • Loading branch information
IgolJack committed Sep 20, 2024
2 parents d00d7cb + 1cc9ad9 commit 0511698
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 11 deletions.
6 changes: 3 additions & 3 deletions common/CollaborativeEditingBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@
};
CCollaborativeChanges.prototype.private_SaveData = function(Binary)
{
var Writer = AscCommon.History.BinaryWriter;
var Pos = Binary.Pos;
var Len = Binary.Len;
let Writer = AscCommon.History.BinaryWriter;
let Pos = Binary.Pos;
let Len = Binary.Len;
if ((Asc.editor || editor).binaryChanges) {
return Writer.GetDataUint8(Pos, Len);
} else {
Expand Down
15 changes: 14 additions & 1 deletion pdf/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@
}, AscDFH.historydescription_Pdf_AddAnnot, this);
}

if (oDoc.checkDefaultFonts(addFreeText)) {
if (oDoc.checkFonts(["Arial"], addFreeText)) {
addFreeText();
}
};
Expand Down Expand Up @@ -1736,6 +1736,18 @@
window["AscDesktopEditor"]["onDocumentModifiedChanged"](bValue);
}
};
PDFEditorApi.prototype.CheckChangedDocument = function() {
let oDoc = this.getPDFDoc();

if (true === oDoc.History.Have_Changes()) {
this.SetDocumentModified(true);
}
else {
this.SetDocumentModified(false);
}

this._onUpdateDocumentCanSave();
};
PDFEditorApi.prototype._autoSaveInner = function() {
let _curTime = new Date();
if (null === this.lastSaveTime) {
Expand Down Expand Up @@ -2546,6 +2558,7 @@
PDFEditorApi.prototype['asc_getHeaderFooterProperties'] = PDFEditorApi.prototype.asc_getHeaderFooterProperties;
PDFEditorApi.prototype['ChangeReaderMode'] = PDFEditorApi.prototype.ChangeReaderMode;

PDFEditorApi.prototype['CheckChangedDocument'] = PDFEditorApi.prototype.CheckChangedDocument;
PDFEditorApi.prototype['SetDrawingFreeze'] = PDFEditorApi.prototype.SetDrawingFreeze;
PDFEditorApi.prototype['OnMouseUp'] = PDFEditorApi.prototype.OnMouseUp;

Expand Down
10 changes: 8 additions & 2 deletions pdf/src/CollaborativeEditing.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,18 @@ CPDFCollaborativeEditing.prototype.GetDocument = function() {
CPDFCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, AdditionalInfo, IsUpdateInterface, isAfterAskSave) {
if (!this.canSendChanges())
return;

// Пересчитываем позиции
this.Refresh_DCChanges();

let oDoc = this.GetDocument();
let oHistory = oDoc.History;


let localHistory = AscCommon.History;
AscCommon.History = oHistory;

AscCommon.DocumentEditorApi.prototype.asc_Save.apply(this, arguments);


// Генерируем свои изменения
let StartPoint = ( null === oHistory.SavedIndex ? 0 : oHistory.SavedIndex + 1 );
let LastPoint = -1;
Expand Down Expand Up @@ -222,6 +227,7 @@ CPDFCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, Additiona
}

editor.WordControl.m_oLogicDocument.getCompositeInput().checkState();
AscCommon.History = localHistory;
};
CPDFCollaborativeEditing.prototype.OnEnd_Load_Objects = function()
{
Expand Down
8 changes: 6 additions & 2 deletions pdf/src/annotations/textPrTrackHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,15 @@

if (!oAnnot)
return null;


let oDoc = oAnnot.GetDocument();
if (!oDoc) {
return null;
}

let aOrigRect = oAnnot.GetOrigRect();
let aRD = oAnnot.GetRectangleDiff() || [0, 0, 0, 0]; // отступ координат фигуры с текстом от ректа аннотации
let nPage = oAnnot.GetPage();
let oDoc = oAnnot.GetDocument();
let oTr = oDoc.pagesTransform[nPage].invert;

let aFreeTextRect = []; // прямоугольник
Expand Down
4 changes: 2 additions & 2 deletions pdf/src/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -4724,7 +4724,7 @@ var CPresentation = CPresentation || function(){};
case AscPDF.FREE_TEXT_INTENT_TYPE.FreeText: {
oFreeText.SetIntent(AscPDF.FREE_TEXT_INTENT_TYPE.FreeText);
oFreeText.SetSubject('Text box');
return;
break;
}
// прописываем RD и Callout
case AscPDF.FREE_TEXT_INTENT_TYPE.FreeTextCallout: {
Expand Down Expand Up @@ -4782,7 +4782,7 @@ var CPresentation = CPresentation || function(){};
}

oFreeText.SetCallout([x1, y1, x2, y2, x3, y3]);
return;
break;
}
}

Expand Down
3 changes: 2 additions & 1 deletion pdf/src/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3513,7 +3513,8 @@
}
else if ( e.KeyCode == 83 && true === e.CtrlKey ) // Ctrl + S + ...
{
// nothing
oDoc.BlurActiveObject();
this.Api.asc_Save(false);
bRetValue = true;
}
else if ( e.KeyCode == 89 && true === e.CtrlKey ) // Ctrl + Y
Expand Down

0 comments on commit 0511698

Please sign in to comment.