Merge pull request 'Fix bug #72500' (#488) from fix/bug-72500 into release/v8.3.0

This commit is contained in:
Ilya Kirillov
2025-01-16 10:57:00 +00:00
6 changed files with 79 additions and 20 deletions

View File

@ -1222,27 +1222,24 @@
return true;
};
CCollaborativeEditingBase.prototype._PreUndo = function()
{
// Метод для перегрузки, чтобы в каждом редакторе выполнялись свои действия
return null;
};
CCollaborativeEditingBase.prototype._PostUndo = function(state, changes)
{
// Метод для перегрузки, чтобы в каждом редакторе выполнялись свои действия
};
CCollaborativeEditingBase.prototype.PreUndo = function()
{
let logicDocument = this.m_oLogicDocument;
logicDocument.sendEvent("asc_onBeforeUndoRedoInCollaboration");
logicDocument.DrawingDocument.EndTrackTable(null, true);
logicDocument.TurnOffCheckChartSelection();
return this.private_SaveDocumentState();
this.m_oLogicDocument.sendEvent("asc_onBeforeUndoRedoInCollaboration");
return this._PreUndo();
};
CCollaborativeEditingBase.prototype.PostUndo = function(state, changes)
{
this.private_RestoreDocumentState(state);
this.private_RecalculateDocument(changes);
let logicDocument = this.m_oLogicDocument;
logicDocument.TurnOnCheckChartSelection();
logicDocument.UpdateSelection();
logicDocument.UpdateInterface();
logicDocument.UpdateRulers();
logicDocument.sendEvent("asc_onUndoRedoInCollaboration");
this._PostUndo(state, changes);
this.m_oLogicDocument.sendEvent("asc_onUndoRedoInCollaboration");
};
CCollaborativeEditingBase.prototype.UndoGlobal = function(count)
{

View File

@ -326,6 +326,14 @@ CPDFCollaborativeEditing.prototype.Release_Locks = function() {
}
}
};
CPDFCollaborativeEditing.prototype._PreUndo = function() {
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----------------------------------------------------
window['AscPDF'] = window['AscPDF'] || {};

View File

@ -1354,7 +1354,6 @@
return bRet;
};
CGraphicObjects.prototype.loadDocumentStateAfterLoadChanges = function() {};
CGraphicObjects.prototype.saveDocumentState = function(){};
CGraphicObjects.prototype.getAllRasterImagesOnPage = function(pageIndex) {
@ -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() {};

View File

@ -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() {};
@ -6118,7 +6140,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() {};

View File

@ -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;

View File

@ -421,6 +421,26 @@ CWordCollaborativeEditing.prototype.End_CollaborationEditing = function()
this.m_nUseType = 0;
}
};
CWordCollaborativeEditing.prototype._PreUndo = function()
{
let logicDocument = this.m_oLogicDocument;
logicDocument.DrawingDocument.EndTrackTable(null, true);
logicDocument.TurnOffCheckChartSelection();
return this.private_SaveDocumentState()
};
CWordCollaborativeEditing.prototype._PostUndo = function(state, changes)
{
this.private_RestoreDocumentState(state);
this.private_RecalculateDocument(changes);
let logicDocument = this.m_oLogicDocument;
logicDocument.TurnOnCheckChartSelection();
logicDocument.UpdateSelection();
logicDocument.UpdateInterface();
logicDocument.UpdateRulers();
};
//----------------------------------------------------------------------------------------------------------------------
// Функции для работы с сохраненными позициями документа.
//----------------------------------------------------------------------------------------------------------------------