Skip to content

Commit

Permalink
For bug #72500
Browse files Browse the repository at this point in the history
  • Loading branch information
KhromovNikita committed Jan 16, 2025
1 parent 0f24da0 commit 14001a3
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 10 deletions.
5 changes: 4 additions & 1 deletion pdf/src/CollaborativeEditing.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,12 @@ CPDFCollaborativeEditing.prototype.Release_Locks = function() {
}
};
CPDFCollaborativeEditing.prototype._PreUndo = function() {
return null;
return this.private_SaveDocumentState()
};
CPDFCollaborativeEditing.prototype._PostUndo = function(state, changes) {
let logicDocument = this.m_oLogicDocument;
this.private_RestoreDocumentState(state);
logicDocument.History.Get_RecalcData(null, changes)
};

//--------------------------------------------------------export----------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pdf/src/GraphicObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,6 @@
return bRet;
};

CGraphicObjects.prototype.loadDocumentStateAfterLoadChanges = function() {};
CGraphicObjects.prototype.saveDocumentState = function(){};

CGraphicObjects.prototype.getAllRasterImagesOnPage = function(pageIndex) {
Expand Down Expand Up @@ -1396,6 +1395,7 @@
CGraphicObjects.prototype.getDrawingsPasteShift = AscFormat.DrawingObjectsController.prototype.getDrawingsPasteShift;
CGraphicObjects.prototype.removeCallback = AscFormat.DrawingObjectsController.prototype.removeCallback;
CGraphicObjects.prototype.getAllSingularDrawings = AscFormat.DrawingObjectsController.prototype.getAllSingularDrawings;
CGraphicObjects.prototype.loadDocumentStateAfterLoadChanges = AscFormat.DrawingObjectsController.prototype.loadDocumentStateAfterLoadChanges;

CGraphicObjects.prototype.startRecalculate = function() {};

Expand Down
34 changes: 31 additions & 3 deletions pdf/src/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -5628,8 +5628,30 @@ var CPresentation = CPresentation || function(){};
CPDFDoc.prototype.PauseRecalculate = function() {};
CPDFDoc.prototype.EndPreview_MailMergeResult = function() {};
CPDFDoc.prototype.Get_SelectionState2 = function() {};
CPDFDoc.prototype.Save_DocumentStateBeforeLoadChanges = function() {};
CPDFDoc.prototype.Load_DocumentStateAfterLoadChanges = function() {};
CPDFDoc.prototype.Save_DocumentStateBeforeLoadChanges = function() {
let State = {};

State.activeObject = this.GetActiveObject();

State.Pos = [];
State.StartPos = [];
State.EndPos = [];

this.GetController().Save_DocumentStateBeforeLoadChanges(State);
this.RemoveSelection();

this.CollaborativeEditing.WatchDocumentPositionsByState(State);

return State;
};
CPDFDoc.prototype.Load_DocumentStateAfterLoadChanges = function(State) {
this.CollaborativeEditing.UpdateDocumentPositionsByState(State);

this.RemoveSelection();
this.SetMouseDownObject(State.activeObject)

this.GetController().Load_DocumentStateAfterLoadChanges(State);
};
CPDFDoc.prototype.Check_MergeData = function() {};
CPDFDoc.prototype.Set_SelectionState2 = function() {};
CPDFDoc.prototype.ResumeRecalculate = function() {};
Expand Down Expand Up @@ -6129,7 +6151,13 @@ var CPresentation = CPresentation || function(){};
CPDFDoc.prototype.Document_UpdateUndoRedoState = function() {
this.UpdateUndoRedo();
};
CPDFDoc.prototype.RecalculateCurPos = function() {};
CPDFDoc.prototype.RecalculateCurPos = function() {
let oAcitveObj = this.GetActiveObject();
let oContent = oAcitveObj ? oAcitveObj.GetDocContent() : null;
if (oContent) {
oContent.RecalculateCurPos();
}
};
CPDFDoc.prototype.HaveRevisionChanges = function() {};
CPDFDoc.prototype.ContinueSpellCheck = function() {};
CPDFDoc.prototype.ContinueTrackRevisions = function() {};
Expand Down
5 changes: 0 additions & 5 deletions pdf/src/drawings/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@
if (this.IsNeedRecalc() == false)
return;

let oContent = this.GetDocContent();
if (oContent) {
oContent.RecalculateCurPos();
}

this.recalculateTransform();
this.updateTransformMatrix();
this.recalculate();
Expand Down
6 changes: 6 additions & 0 deletions pdf/src/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@
AscFormat.InitClass(CPageInfo, AscFormat.CBaseNoIdObject, AscDFH.historyitem_type_Pdf_Page);
CPageInfo.prototype.constructor = CPageInfo;

Object.defineProperty(CPageInfo.prototype, "PageNum", {
get: function () {
return this.GetIndex();
}
});

CPageInfo.prototype.RedrawDrawings = function() {
let oViewer = Asc.editor.getDocumentRenderer();
let _t = this;
Expand Down

0 comments on commit 14001a3

Please sign in to comment.