diff --git a/www/common/onlyoffice/v4/sdkjs/cell/sdk-all.js b/www/common/onlyoffice/v4/sdkjs/cell/sdk-all.js index cdefc6082..bd569223c 100644 --- a/www/common/onlyoffice/v4/sdkjs/cell/sdk-all.js +++ b/www/common/onlyoffice/v4/sdkjs/cell/sdk-all.js @@ -8425,87 +8425,88 @@ oThis.loadImageCallBackCounterMax)oThis.LoadImagesWithCallbackEnd()};oImage.Imag this.loadImageCallBackArgs);this.loadImageCallBack=null;this.loadImageCallBackArgs=null;this.loadImageCallBackCounterMax=0;this.loadImageCallBackCounter=0}}var g_flow_anchor=new Image;g_flow_anchor.asc_complete=false;g_flow_anchor.onload=function(){g_flow_anchor.asc_complete=true};g_flow_anchor.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPBAMAAADNDVhEAAAAIVBMVEUAAAANDQ0NDQ0NDQ0NDQ0NDQ0AAAANDQ0NDQ0NDQ0NDQ1jk7YPAAAACnRSTlMAGkD4mb9c5s9TDghpXQAAAFZJREFUCNdjYGBgW8YABlxcIBLBZ1gAEfZa5QWiGRkWMAIpAaA4iHQE0YwODEtANMsChkIwv4BBWQBICyswMC1iWADEDAzKoUuDFUAGNC9uABvIaQkkABpxD6lFb9lRAAAAAElFTkSuQmCC"; var g_flow_anchor2=new Image;g_flow_anchor2.asc_complete=false;g_flow_anchor2.onload=function(){g_flow_anchor2.asc_complete=true};g_flow_anchor2.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAeCAMAAAAFBf7qAAAAOVBMVEUAAAAAAAAAAAAAAAAJCQkAAAAJCQkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJCQknI0ZQAAAAEnRSTlMAx9ITlAfyPHxn68yecTAl5qt6y0BvAAAAt0lEQVQoz8WS0QrDIAxFk0ajtlXb+/8fuzAprltg7Gnn4aIcvAgJTSSoBiGPoIAGV60qoquvIIL110IJgPONmKIlMI73MiwGRoZvahbKVSizcDKU8QeVPDXEIr6ShVB9VUEn2FOMkwL8VwjUtuypvDWiHeVTFeyWkZHfVQZHGm4XMhKQyJB9GKMxuHQSBlioF7u2q7kzgO2AcWwW3F8mWRmGKgyu91mK1Tzh4ixVVkBzJI/EnGjyACbfCaO3eIWRAAAAAElFTkSuQmCC"; window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].g_font_loader=new CGlobalFontLoader;window["AscCommon"].g_image_loader=new CGlobalImageLoader;window["AscCommon"].g_flow_anchor=g_flow_anchor;window["AscCommon"].g_flow_anchor2=g_flow_anchor2})(window,window.document);"use strict";(function(window,undefined){var FOREIGN_CURSOR_LABEL_HIDETIME=1500;function CCollaborativeChanges(){this.m_pData=null;this.m_oColor=null}CCollaborativeChanges.prototype.Set_Data=function(pData){this.m_pData= -pData};CCollaborativeChanges.prototype.Set_Color=function(oColor){this.m_oColor=oColor};CCollaborativeChanges.prototype.Set_FromUndoRedo=function(Class,Data,Binary){if(!Class.Get_Id)return false;this.m_pData=this.private_SaveData(Binary);return true};CCollaborativeChanges.prototype.Apply_Data=function(){var CollaborativeEditing=AscCommon.CollaborativeEditing;var Reader=this.private_LoadData(this.m_pData);var ClassId=Reader.GetString2();var Class=AscCommon.g_oTableId.Get_ById(ClassId);if(!Class)return false; -var nReaderPos=Reader.GetCurPos();var nChangesType=Reader.GetLong();var fChangesClass=AscDFH.changesFactory[nChangesType];if(fChangesClass){var oChange=new fChangesClass(Class);oChange.ReadFromBinary(Reader);if(true===CollaborativeEditing.private_AddOverallChange(oChange))oChange.Load(this.m_oColor);return true}else{CollaborativeEditing.private_AddOverallChange(this.m_pData);Reader.Seek2(nReaderPos);if(!Class.Load_Changes)return false;return Class.Load_Changes(Reader,null,this.m_oColor)}};CCollaborativeChanges.prototype.private_LoadData= -function(szSrc){return this.GetStream(szSrc,0,szSrc.length)};CCollaborativeChanges.prototype.GetStream=function(szSrc,offset,srcLen){var nWritten=0;var index=-1+offset;var dst_len="";while(true){index++;var _c=szSrc.charCodeAt(index);if(_c==";".charCodeAt(0)){index++;break}dst_len+=String.fromCharCode(_c)}var dstLen=parseInt(dst_len);var pointer=AscFonts.g_memory.Alloc(dstLen);var stream=new AscCommon.FT_Stream2(pointer.data,dstLen);stream.obj=pointer.obj;var dstPx=stream.data;if(window.chrome)while(index< -srcLen){var dwCurr=0;var i;var nBits=0;for(i=0;i<4;i++){if(index>=srcLen)break;var nCh=AscFonts.DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i>>16;dwCurr<<=8}}else{var p=AscFonts.b64_decode;while(index=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|= -nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i>>16;dwCurr<<=8}}}return stream};CCollaborativeChanges.prototype.private_SaveData=function(Binary){var Writer=AscCommon.History.BinaryWriter;var Pos=Binary.Pos;var Len=Binary.Len;return Len+";"+Writer.GetBase64Memory2(Pos,Len)};function CCollaborativeEditingBase(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions= -[];this.m_bGlobalLock=0;this.m_bGlobalLockSelection=0;this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[];this.m_aDC={};this.m_aChangedClasses={};this.m_oMemory=null;this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId={};this.m_bFast=false;this.m_oLogicDocument=null;this.m_aDocumentPositions=new CDocumentPositionsManager;this.m_aForeignCursorsPos=new CDocumentPositionsManager;this.m_aForeignCursors={};this.m_aForeignCursorsId={};this.m_nAllChangesSavedIndex= -0;this.m_aAllChanges=[];this.m_aOwnChangesIndexes=[];this.m_oOwnChanges=[]}CCollaborativeEditingBase.prototype.Clear=function(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[]};CCollaborativeEditingBase.prototype.Set_Fast=function(bFast){this.m_bFast=bFast;if(false===bFast){this.Remove_AllForeignCursors(); -this.RemoveMyCursorFromOthers()}};CCollaborativeEditingBase.prototype.Is_Fast=function(){return this.m_bFast};CCollaborativeEditingBase.prototype.Is_SingleUser=function(){return 1===this.m_nUseType};CCollaborativeEditingBase.prototype.getCollaborativeEditing=function(){return!this.Is_SingleUser()};CCollaborativeEditingBase.prototype.Start_CollaborationEditing=function(){this.m_nUseType=-1};CCollaborativeEditingBase.prototype.End_CollaborationEditing=function(){if(this.m_nUseType<=0)this.m_nUseType= -0};CCollaborativeEditingBase.prototype.Add_User=function(UserId){if(-1===this.Find_User(UserId))this.m_aUsers.push(UserId)};CCollaborativeEditingBase.prototype.Find_User=function(UserId){var Len=this.m_aUsers.length;for(var Index=0;Index0;if(true===OtherChanges){AscFonts.IsCheckSymbols=true;editor.WordControl.m_oLogicDocument.StopRecalculate(); -editor.WordControl.m_oLogicDocument.EndPreview_MailMergeResult();editor.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.ApplyChanges);var DocState=this.private_SaveDocumentState();this.Clear_NewImages();this.Apply_OtherChanges();this.Lock_NeedLock();this.private_RestoreDocumentState(DocState);this.OnStart_Load_Objects();AscFonts.IsCheckSymbols=false}};CCollaborativeEditingBase.prototype.Apply_OtherChanges=function(){AscCommon.g_oIdCounter.Set_Load(true);if(this.m_aChanges.length> -0)this.private_CollectOwnChanges();var _count=this.m_aChanges.length;for(var i=0;i<_count;i++){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;var Changes=this.m_aChanges[i];Changes.Apply_Data()}this.private_ClearChanges();this.Apply_LinkData();this.Check_MergeData();this.OnEnd_ReadForeignChanges();AscCommon.g_oIdCounter.Set_Load(false)};CCollaborativeEditingBase.prototype.getOwnLocksLength=function(){return this.m_aNeedUnlock2.length}; -CCollaborativeEditingBase.prototype.Send_Changes=function(){};CCollaborativeEditingBase.prototype.Release_Locks=function(){};CCollaborativeEditingBase.prototype.CheckWaitingImages=function(aImages){};CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges=function(aImages){var rData={},oApi=editor||Asc["editor"],i;if(!oApi)return;rData["c"]="pathurls";rData["data"]=[];for(i=0;i0)this.SendImagesUrlsFromChanges(aImages);else{this.SendImagesCallback([].concat(this.m_aNewImages)); -this.m_aNewImages.length=0}};CCollaborativeEditingBase.prototype.OnEnd_Load_Objects=function(){};CCollaborativeEditingBase.prototype.Clear_LinkData=function(){this.m_aLinkData.length=0};CCollaborativeEditingBase.prototype.Add_LinkData=function(Class,LinkData){this.m_aLinkData.push({Class:Class,LinkData:LinkData})};CCollaborativeEditingBase.prototype.Apply_LinkData=function(){var Count=this.m_aLinkData.length;for(var Index=0;Index0){this.m_aOwnChangesIndexes.push({Position:this.m_aAllChanges.length,Count:arrChanges.length});this.m_aAllChanges= -this.m_aAllChanges.concat(arrChanges)}};CCollaborativeEditingBase.prototype.Undo=function(){if(true===this.Get_GlobalLock())return;if(this.m_aOwnChangesIndexes.length<=0)return false;var arrChanges=[];var oIndexes=this.m_aOwnChangesIndexes[this.m_aOwnChangesIndexes.length-1];var nPosition=oIndexes.Position;var nCount=oIndexes.Count;for(var nIndex=nCount-1;nIndex>=0;--nIndex){var oChange=this.m_aAllChanges[nPosition+nIndex];if(!oChange)continue;var oClass=oChange.GetClass();if(oChange.IsContentChange()){var _oChange= -oChange.Copy();if(this.private_CommutateContentChanges(_oChange,nPosition+nCount))arrChanges.push(_oChange);oChange.SetReverted(true)}else{var _oChange=oChange;if(this.private_CommutatePropertyChanges(oClass,_oChange,nPosition+nCount))arrChanges.push(_oChange)}}this.m_aOwnChangesIndexes.length=this.m_aOwnChangesIndexes.length-1;var arrReverseChanges=[];for(var nIndex=0,nCount=arrChanges.length;nIndex-1;--i)if(mapAddedSlides[oLogicDocument.Slides[i].Get_Id()]&&!oLogicDocument.Slides[i].Layout)oLogicDocument.removeSlide(i);for(var sId in mapSlides)if(mapSlides.hasOwnProperty(sId))mapSlides[sId].correctContent();if(bChangedLayout)for(var i=oLogicDocument.Slides.length-1;i>-1;--i){var Layout=oLogicDocument.Slides[i].Layout;if(!Layout||mapLayouts[Layout.Get_Id()])if(!oLogicDocument.Slides[i].CheckLayout())oLogicDocument.removeSlide(i)}for(var sId in mapGrObjects){var oShape= -mapGrObjects[sId];if(!oShape.checkCorrect()){oShape.setBDeleted(true);if(oShape.group)oShape.group.removeFromSpTree(oShape.Get_Id());else if(AscFormat.Slide&&oShape.parent instanceof AscFormat.Slide)oShape.parent.removeFromSpTreeById(oShape.Get_Id());else if(AscCommonWord.ParaDrawing&&oShape.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oShape.parent.Get_Id()]=oShape.parent}else if(oShape.resetGroups)oShape.resetGroups()}var oDrawing;for(var sId in mapDrawings)if(mapDrawings.hasOwnProperty(sId)){oDrawing= -mapDrawings[sId];if(!oDrawing.CheckCorrect()){var oParentParagraph=oDrawing.Get_ParentParagraph();oDrawing.PreDelete();oDrawing.Remove_FromDocument(false);if(oParentParagraph)mapParagraphs[oParentParagraph.Get_Id()]=oParentParagraph}}for(var sId in mapRuns)if(mapRuns.hasOwnProperty(sId)){var oRun=mapRuns[sId];for(var nIndex=oRun.Content.length-1;nIndex>-1;--nIndex)if(oRun.Content[nIndex]instanceof AscCommonWord.ParaDrawing)if(!oRun.Content[nIndex].CheckCorrect()){oRun.Remove_FromContent(nIndex,1, -false);if(oRun.Paragraph)mapParagraphs[oRun.Paragraph.Get_Id()]=oRun.Paragraph}}for(var sId in mapTables){var oTable=mapTables[sId];for(var nCurRow=oTable.Content.length-1;nCurRow>=0;--nCurRow){var oRow=oTable.Get_Row(nCurRow);if(oRow.Get_CellsCount()<=0)oTable.private_RemoveRow(nCurRow)}if(oTable.Parent instanceof AscCommonWord.CDocument||oTable.Parent instanceof AscCommonWord.CDocumentContent)mapDocumentContents[oTable.Parent.Get_Id()]=oTable.Parent}for(var sId in mapDocumentContents){var oDocumentContent= -mapDocumentContents[sId];var nContentLen=oDocumentContent.Content.length;for(var nIndex=nContentLen-1;nIndex>=0;--nIndex){var oElement=oDocumentContent.Content[nIndex];if((AscCommonWord.type_Paragraph===oElement.GetType()||AscCommonWord.type_Table===oElement.GetType())&&oElement.Content.length<=0)oDocumentContent.Remove_FromContent(nIndex,1)}nContentLen=oDocumentContent.Content.length;if(nContentLen<=0||AscCommonWord.type_Paragraph!==oDocumentContent.Content[nContentLen-1].GetType()){var oNewParagraph= -new AscCommonWord.Paragraph(oLogicDocument.Get_DrawingDocument(),oDocumentContent,0,0,0,0,0,false);oDocumentContent.Add_ToContent(nContentLen,oNewParagraph)}}for(var sId in mapParagraphs){var oParagraph=mapParagraphs[sId];oParagraph.CheckParaEnd();oParagraph.Correct_Content(null,null,true)}var oBinaryWriter=AscCommon.History.BinaryWriter;var aSendingChanges=[];for(var nIndex=0,nCount=arrReverseChanges.length;nIndex=0;--nActionIndex){var oAction=arrActions[nActionIndex];var oResult=oAction;for(var nIndex=nStartPosition,nOverallCount=this.m_aAllChanges.length;nIndex0)oChange.ConvertFromSimpleActions(arrCommutateActions);else return false;return true};CCollaborativeEditingBase.prototype.private_Commutate= -function(oActionL,oActionR){if(oActionL.Add)if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;else oActionR.Pos--;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else if(oActionL.Pos===oActionR.Pos)return false;else oActionR.Pos--;else if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;else oActionR.Pos++;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else oActionR.Pos++;return true};CCollaborativeEditingBase.prototype.private_CommutatePropertyChanges=function(oClass,oChange, -nStartPosition){if(oChange.CheckCorrect&&!oChange.CheckCorrect())return false;return true};CCollaborativeEditingBase.prototype.private_RecalculateDocument=function(oRecalcData){};function CDocumentPositionsManager(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=[]}CDocumentPositionsManager.prototype.Clear_DocumentPositions=function(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=[]};CDocumentPositionsManager.prototype.Add_DocumentPosition= -function(Position){this.m_aDocumentPositions.push(Position)};CDocumentPositionsManager.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndexPos||_Pos.Position===Pos&&!(Class instanceof AscCommonWord.ParaRun))){_Pos.Position++; -break}}}};CDocumentPositionsManager.prototype.Update_DocumentPositionsOnRemove=function(Class,Pos,Count){for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndexPos+Count)_Pos.Position-=Count;else if(_Pos.Position>=Pos){_Pos.Position=Pos;_Pos.Deleted=true}break}}}}; -CDocumentPositionsManager.prototype.OnStart_SplitRun=function(SplitRun,SplitPos){this.m_aDocumentPositionsSplit=[];for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex=SplitPos)this.m_aDocumentPositionsSplit.push({DocPos:DocPos,NewRunPos:_Pos.Position-SplitPos})}}}; -CDocumentPositionsManager.prototype.OnEnd_SplitRun=function(NewRun){if(!NewRun)return;for(var PosIndex=0,PosCount=this.m_aDocumentPositionsSplit.length;PosIndex0&&DocPos[DocPos.length-1].Class instanceof AscCommonWord.ParaRun){var Run=DocPos[DocPos.length-1].Class;var RunPos=DocPos[DocPos.length-1].Position;var Para=Run.GetParagraph();if(AscCommonWord.CanUpdatePosition(Para,Run)){DocPos.length=0;Run.GetDocumentPositionFromObject(DocPos);DocPos.push({Class:Run,Position:RunPos})}}};CDocumentPositionsManager.prototype.Remove_DocumentPosition=function(DocPos){for(var Pos=0,Count= -this.m_aDocumentPositions.length;Pos>0)+"px";this.HtmlElement.style.top=(_y*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.width=((_r-_x)*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.height=((_b-_y)*g_dKoef_mm_to_pix+.5>>0)+"px";if(api!==undefined&&api.CheckRetinaElement&&api.CheckRetinaElement(this.HtmlElement)){var _W=(_r-_x)*g_dKoef_mm_to_pix+.5>>0;var _H=(_b-_y)*g_dKoef_mm_to_pix+.5>>0;this.HtmlElement.width=AscCommon.AscBrowser.convertToRetinaValue(_W,true);this.HtmlElement.height= -AscCommon.AscBrowser.convertToRetinaValue(_H,true)}else{this.HtmlElement.width=(_r-_x)*g_dKoef_mm_to_pix+.5>>0;this.HtmlElement.height=(_b-_y)*g_dKoef_mm_to_pix+.5>>0}};this.GetCSS_width=function(){return(this.AbsolutePosition.R-this.AbsolutePosition.L)*g_dKoef_mm_to_pix+.5>>0};this.GetCSS_height=function(){return(this.AbsolutePosition.B-this.AbsolutePosition.T)*g_dKoef_mm_to_pix+.5>>0}}function CControlContainer(){this.Bounds=new CBounds;this.Anchor=g_anchor_left|g_anchor_top;this.Name=null;this.Parent= -null;this.TabIndex=null;this.HtmlElement=null;this.AbsolutePosition=new CBounds;this.Controls=[];this.AddControl=function(ctrl){ctrl.Parent=this;this.Controls[this.Controls.length]=ctrl};this.Resize=function(_width,_height,api){if(null==this.Parent){this.AbsolutePosition.L=0;this.AbsolutePosition.T=0;this.AbsolutePosition.R=_width;this.AbsolutePosition.B=_height;if(null!=this.HtmlElement){var lCount=this.Controls.length;for(var i=0;i>0)+"px";this.HtmlElement.style.top=(_y*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.width=((_r-_x)*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.height=((_b-_y)*g_dKoef_mm_to_pix+.5>>0)+"px";var lCount=this.Controls.length;for(var i=0;i>0};this.GetCSS_height=function(){return(this.AbsolutePosition.B-this.AbsolutePosition.T)*g_dKoef_mm_to_pix+.5>>0}}function CreateControlContainer(name){var ctrl=new CControlContainer;ctrl.Name=name;ctrl.HtmlElement=document.getElementById(name);return ctrl}function CreateControl(name){var ctrl=new CControl;ctrl.Name=name;ctrl.HtmlElement=document.getElementById(name);return ctrl}window["AscCommon"]=window["AscCommon"]|| -{};window["AscCommon"].g_anchor_left=g_anchor_left;window["AscCommon"].g_anchor_top=g_anchor_top;window["AscCommon"].g_anchor_right=g_anchor_right;window["AscCommon"].g_anchor_bottom=g_anchor_bottom;window["AscCommon"].CreateControlContainer=CreateControlContainer;window["AscCommon"].CreateControl=CreateControl})(window);"use strict";(function(window,undefined){var AscBrowser=AscCommon.AscBrowser;var TRACK_CIRCLE_RADIUS=5;var TRACK_RECT_SIZE2=4;var TRACK_RECT_SIZE=8;var TRACK_RECT_SIZE_CT=6;var TRACK_DISTANCE_ROTATE= -25;var TRACK_DISTANCE_ROTATE2=25;var TRACK_ADJUSTMENT_SIZE=10;var TRACK_WRAPPOINTS_SIZE=6;var IMAGE_ROTATE_TRACK_W=21;var bIsUseImageRotateTrack=true;if(bIsUseImageRotateTrack){window.g_track_rotate_marker=new Image;window.g_track_rotate_marker;window.g_track_rotate_marker.asc_complete=false;window.g_track_rotate_marker.onload=function(){window.g_track_rotate_marker.asc_complete=true};window.g_track_rotate_marker.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAAVFBMVEUAAAD///////////////////////////////////////////////////////98fHy2trb09PTT09OysrKqqqqJiYng4ODr6+uamprGxsbi4uKGhoYjgM0eAAAADnRSTlMAy00k7/z0jbeuMzDljsugwZgAAACpSURBVBjTdZHbEoMgDESDAl6bgIqX9v//s67UYpm6D0xyYMImoaiuUr3pVdVRUtnwqaY8YaE5SRcfaPgqc+DSIh7WIGGaEVoUqRGN4oZlcDIiqYlaPjQz5CNu6cFJwLiuSO3nlLBDrKhn3l4rcnH4NcAdGd5EZMfCsoMFBxM6CD57G+u6vC48PMVnHtrYhP/x+7+3cw7zdJnD3cyA7QXa4nYXaW+a9Xdvb6zqE5Jb7LmzAAAAAElFTkSuQmCC"; +pData};CCollaborativeChanges.prototype.Set_Color=function(oColor){this.m_oColor=oColor};CCollaborativeChanges.prototype.Set_FromUndoRedo=function(Class,Data,Binary){if(!Class.Get_Id)return false;this.m_pData=this.private_SaveData(Binary);return true};CCollaborativeChanges.prototype.Apply_Data=function(){var CollaborativeEditing=AscCommon.CollaborativeEditing;if(this.m_pData&&this.m_pData.type==="cp_theme"){clearTimeout(window.CP_theme_to);var data=this.m_pData;window.CP_theme_to=setTimeout(function(){window.parent.APP.remoteTheme(); +window.editor.ChangeTheme(data.id,null,true)});return true}var Reader=this.private_LoadData(this.m_pData);var ClassId=Reader.GetString2();var Class=AscCommon.g_oTableId.Get_ById(ClassId);if(!Class)return false;var nReaderPos=Reader.GetCurPos();var nChangesType=Reader.GetLong();var fChangesClass=AscDFH.changesFactory[nChangesType];if(fChangesClass){var oChange=new fChangesClass(Class);oChange.ReadFromBinary(Reader);if(true===CollaborativeEditing.private_AddOverallChange(oChange))oChange.Load(this.m_oColor); +return true}else{CollaborativeEditing.private_AddOverallChange(this.m_pData);Reader.Seek2(nReaderPos);if(!Class.Load_Changes)return false;return Class.Load_Changes(Reader,null,this.m_oColor)}};CCollaborativeChanges.prototype.private_LoadData=function(szSrc){return this.GetStream(szSrc,0,szSrc.length)};CCollaborativeChanges.prototype.GetStream=function(szSrc,offset,srcLen){var nWritten=0;var index=-1+offset;var dst_len="";while(true){index++;var _c=szSrc.charCodeAt(index);if(_c==";".charCodeAt(0)){index++; +break}dst_len+=String.fromCharCode(_c)}var dstLen=parseInt(dst_len);var pointer=AscFonts.g_memory.Alloc(dstLen);var stream=new AscCommon.FT_Stream2(pointer.data,dstLen);stream.obj=pointer.obj;var dstPx=stream.data;if(window.chrome)while(index=srcLen)break;var nCh=AscFonts.DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i>>16;dwCurr<<=8}}else{var p=AscFonts.b64_decode;while(index=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i>>16;dwCurr<<=8}}}return stream};CCollaborativeChanges.prototype.private_SaveData=function(Binary){var Writer=AscCommon.History.BinaryWriter;var Pos=Binary.Pos;var Len=Binary.Len; +return Len+";"+Writer.GetBase64Memory2(Pos,Len)};function CCollaborativeEditingBase(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_bGlobalLock=0;this.m_bGlobalLockSelection=0;this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[];this.m_aDC={};this.m_aChangedClasses={};this.m_oMemory=null;this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId= +{};this.m_bFast=false;this.m_oLogicDocument=null;this.m_aDocumentPositions=new CDocumentPositionsManager;this.m_aForeignCursorsPos=new CDocumentPositionsManager;this.m_aForeignCursors={};this.m_aForeignCursorsId={};this.m_nAllChangesSavedIndex=0;this.m_aAllChanges=[];this.m_aOwnChangesIndexes=[];this.m_oOwnChanges=[]}CCollaborativeEditingBase.prototype.Clear=function(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData= +[];this.m_aEndActions=[];this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[]};CCollaborativeEditingBase.prototype.Set_Fast=function(bFast){this.m_bFast=bFast;if(false===bFast){this.Remove_AllForeignCursors();this.RemoveMyCursorFromOthers()}};CCollaborativeEditingBase.prototype.Is_Fast=function(){return this.m_bFast};CCollaborativeEditingBase.prototype.Is_SingleUser=function(){return 1===this.m_nUseType};CCollaborativeEditingBase.prototype.getCollaborativeEditing= +function(){return!this.Is_SingleUser()};CCollaborativeEditingBase.prototype.Start_CollaborationEditing=function(){this.m_nUseType=-1};CCollaborativeEditingBase.prototype.End_CollaborationEditing=function(){if(this.m_nUseType<=0)this.m_nUseType=0};CCollaborativeEditingBase.prototype.Add_User=function(UserId){if(-1===this.Find_User(UserId))this.m_aUsers.push(UserId)};CCollaborativeEditingBase.prototype.Find_User=function(UserId){var Len=this.m_aUsers.length;for(var Index=0;Index0;if(true===OtherChanges){AscFonts.IsCheckSymbols=true;editor.WordControl.m_oLogicDocument.StopRecalculate();editor.WordControl.m_oLogicDocument.EndPreview_MailMergeResult();editor.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.ApplyChanges);var DocState=this.private_SaveDocumentState();this.Clear_NewImages();this.Apply_OtherChanges(); +this.Lock_NeedLock();this.private_RestoreDocumentState(DocState);this.OnStart_Load_Objects();AscFonts.IsCheckSymbols=false}};CCollaborativeEditingBase.prototype.Apply_OtherChanges=function(){AscCommon.g_oIdCounter.Set_Load(true);if(this.m_aChanges.length>0)this.private_CollectOwnChanges();var _count=this.m_aChanges.length;for(var i=0;i<_count;i++){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;var Changes=this.m_aChanges[i]; +Changes.Apply_Data()}this.private_ClearChanges();this.Apply_LinkData();this.Check_MergeData();this.OnEnd_ReadForeignChanges();AscCommon.g_oIdCounter.Set_Load(false)};CCollaborativeEditingBase.prototype.getOwnLocksLength=function(){return this.m_aNeedUnlock2.length};CCollaborativeEditingBase.prototype.Send_Changes=function(){};CCollaborativeEditingBase.prototype.Release_Locks=function(){};CCollaborativeEditingBase.prototype.CheckWaitingImages=function(aImages){};CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges= +function(aImages){var rData={},oApi=editor||Asc["editor"],i;if(!oApi)return;rData["c"]="pathurls";rData["data"]=[];for(i=0;i0)this.SendImagesUrlsFromChanges(aImages);else{this.SendImagesCallback([].concat(this.m_aNewImages));this.m_aNewImages.length=0}};CCollaborativeEditingBase.prototype.OnEnd_Load_Objects=function(){};CCollaborativeEditingBase.prototype.Clear_LinkData=function(){this.m_aLinkData.length=0};CCollaborativeEditingBase.prototype.Add_LinkData=function(Class,LinkData){this.m_aLinkData.push({Class:Class,LinkData:LinkData})}; +CCollaborativeEditingBase.prototype.Apply_LinkData=function(){var Count=this.m_aLinkData.length;for(var Index=0;Index +0){this.m_aOwnChangesIndexes.push({Position:this.m_aAllChanges.length,Count:arrChanges.length});this.m_aAllChanges=this.m_aAllChanges.concat(arrChanges)}};CCollaborativeEditingBase.prototype.Undo=function(){if(true===this.Get_GlobalLock())return;if(this.m_aOwnChangesIndexes.length<=0)return false;var arrChanges=[];var oIndexes=this.m_aOwnChangesIndexes[this.m_aOwnChangesIndexes.length-1];var nPosition=oIndexes.Position;var nCount=oIndexes.Count;for(var nIndex=nCount-1;nIndex>=0;--nIndex){var oChange= +this.m_aAllChanges[nPosition+nIndex];if(!oChange)continue;var oClass=oChange.GetClass();if(oChange.IsContentChange()){var _oChange=oChange.Copy();if(this.private_CommutateContentChanges(_oChange,nPosition+nCount))arrChanges.push(_oChange);oChange.SetReverted(true)}else{var _oChange=oChange;if(this.private_CommutatePropertyChanges(oClass,_oChange,nPosition+nCount))arrChanges.push(_oChange)}}this.m_aOwnChangesIndexes.length=this.m_aOwnChangesIndexes.length-1;var arrReverseChanges=[];for(var nIndex= +0,nCount=arrChanges.length;nIndex-1;--i)if(mapAddedSlides[oLogicDocument.Slides[i].Get_Id()]&&!oLogicDocument.Slides[i].Layout)oLogicDocument.removeSlide(i);for(var sId in mapSlides)if(mapSlides.hasOwnProperty(sId))mapSlides[sId].correctContent();if(bChangedLayout)for(var i=oLogicDocument.Slides.length-1;i>-1;--i){var Layout= +oLogicDocument.Slides[i].Layout;if(!Layout||mapLayouts[Layout.Get_Id()])if(!oLogicDocument.Slides[i].CheckLayout())oLogicDocument.removeSlide(i)}for(var sId in mapGrObjects){var oShape=mapGrObjects[sId];if(!oShape.checkCorrect()){oShape.setBDeleted(true);if(oShape.group)oShape.group.removeFromSpTree(oShape.Get_Id());else if(AscFormat.Slide&&oShape.parent instanceof AscFormat.Slide)oShape.parent.removeFromSpTreeById(oShape.Get_Id());else if(AscCommonWord.ParaDrawing&&oShape.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oShape.parent.Get_Id()]= +oShape.parent}else if(oShape.resetGroups)oShape.resetGroups()}var oDrawing;for(var sId in mapDrawings)if(mapDrawings.hasOwnProperty(sId)){oDrawing=mapDrawings[sId];if(!oDrawing.CheckCorrect()){var oParentParagraph=oDrawing.Get_ParentParagraph();oDrawing.PreDelete();oDrawing.Remove_FromDocument(false);if(oParentParagraph)mapParagraphs[oParentParagraph.Get_Id()]=oParentParagraph}}for(var sId in mapRuns)if(mapRuns.hasOwnProperty(sId)){var oRun=mapRuns[sId];for(var nIndex=oRun.Content.length-1;nIndex> +-1;--nIndex)if(oRun.Content[nIndex]instanceof AscCommonWord.ParaDrawing)if(!oRun.Content[nIndex].CheckCorrect()){oRun.Remove_FromContent(nIndex,1,false);if(oRun.Paragraph)mapParagraphs[oRun.Paragraph.Get_Id()]=oRun.Paragraph}}for(var sId in mapTables){var oTable=mapTables[sId];for(var nCurRow=oTable.Content.length-1;nCurRow>=0;--nCurRow){var oRow=oTable.Get_Row(nCurRow);if(oRow.Get_CellsCount()<=0)oTable.private_RemoveRow(nCurRow)}if(oTable.Parent instanceof AscCommonWord.CDocument||oTable.Parent instanceof +AscCommonWord.CDocumentContent)mapDocumentContents[oTable.Parent.Get_Id()]=oTable.Parent}for(var sId in mapDocumentContents){var oDocumentContent=mapDocumentContents[sId];var nContentLen=oDocumentContent.Content.length;for(var nIndex=nContentLen-1;nIndex>=0;--nIndex){var oElement=oDocumentContent.Content[nIndex];if((AscCommonWord.type_Paragraph===oElement.GetType()||AscCommonWord.type_Table===oElement.GetType())&&oElement.Content.length<=0)oDocumentContent.Remove_FromContent(nIndex,1)}nContentLen= +oDocumentContent.Content.length;if(nContentLen<=0||AscCommonWord.type_Paragraph!==oDocumentContent.Content[nContentLen-1].GetType()){var oNewParagraph=new AscCommonWord.Paragraph(oLogicDocument.Get_DrawingDocument(),oDocumentContent,0,0,0,0,0,false);oDocumentContent.Add_ToContent(nContentLen,oNewParagraph)}}for(var sId in mapParagraphs){var oParagraph=mapParagraphs[sId];oParagraph.CheckParaEnd();oParagraph.Correct_Content(null,null,true)}var oBinaryWriter=AscCommon.History.BinaryWriter;var aSendingChanges= +[];for(var nIndex=0,nCount=arrReverseChanges.length;nIndex=0;--nActionIndex){var oAction=arrActions[nActionIndex];var oResult=oAction;for(var nIndex=nStartPosition,nOverallCount=this.m_aAllChanges.length;nIndex0)oChange.ConvertFromSimpleActions(arrCommutateActions);else return false;return true};CCollaborativeEditingBase.prototype.private_Commutate=function(oActionL,oActionR){if(oActionL.Add)if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;else oActionR.Pos--;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else if(oActionL.Pos===oActionR.Pos)return false;else oActionR.Pos--;else if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++; +else oActionR.Pos++;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else oActionR.Pos++;return true};CCollaborativeEditingBase.prototype.private_CommutatePropertyChanges=function(oClass,oChange,nStartPosition){if(oChange.CheckCorrect&&!oChange.CheckCorrect())return false;return true};CCollaborativeEditingBase.prototype.private_RecalculateDocument=function(oRecalcData){};function CDocumentPositionsManager(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap= +[]}CDocumentPositionsManager.prototype.Clear_DocumentPositions=function(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=[]};CDocumentPositionsManager.prototype.Add_DocumentPosition=function(Position){this.m_aDocumentPositions.push(Position)};CDocumentPositionsManager.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndexPos||_Pos.Position===Pos&&!(Class instanceof AscCommonWord.ParaRun))){_Pos.Position++;break}}}};CDocumentPositionsManager.prototype.Update_DocumentPositionsOnRemove=function(Class,Pos,Count){for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndexPos+Count)_Pos.Position-=Count;else if(_Pos.Position>=Pos){_Pos.Position=Pos;_Pos.Deleted=true}break}}}};CDocumentPositionsManager.prototype.OnStart_SplitRun=function(SplitRun,SplitPos){this.m_aDocumentPositionsSplit=[];for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex=SplitPos)this.m_aDocumentPositionsSplit.push({DocPos:DocPos,NewRunPos:_Pos.Position-SplitPos})}}};CDocumentPositionsManager.prototype.OnEnd_SplitRun=function(NewRun){if(!NewRun)return;for(var PosIndex=0,PosCount=this.m_aDocumentPositionsSplit.length;PosIndex0&&DocPos[DocPos.length-1].Class instanceof AscCommonWord.ParaRun){var Run=DocPos[DocPos.length-1].Class;var RunPos=DocPos[DocPos.length-1].Position;var Para=Run.GetParagraph();if(AscCommonWord.CanUpdatePosition(Para, +Run)){DocPos.length=0;Run.GetDocumentPositionFromObject(DocPos);DocPos.push({Class:Run,Position:RunPos})}}};CDocumentPositionsManager.prototype.Remove_DocumentPosition=function(DocPos){for(var Pos=0,Count=this.m_aDocumentPositions.length;Pos>0)+"px";this.HtmlElement.style.top=(_y*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.width=((_r-_x)*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.height=((_b-_y)*g_dKoef_mm_to_pix+.5>>0)+"px";if(api!==undefined&&api.CheckRetinaElement&& +api.CheckRetinaElement(this.HtmlElement)){var _W=(_r-_x)*g_dKoef_mm_to_pix+.5>>0;var _H=(_b-_y)*g_dKoef_mm_to_pix+.5>>0;this.HtmlElement.width=AscCommon.AscBrowser.convertToRetinaValue(_W,true);this.HtmlElement.height=AscCommon.AscBrowser.convertToRetinaValue(_H,true)}else{this.HtmlElement.width=(_r-_x)*g_dKoef_mm_to_pix+.5>>0;this.HtmlElement.height=(_b-_y)*g_dKoef_mm_to_pix+.5>>0}};this.GetCSS_width=function(){return(this.AbsolutePosition.R-this.AbsolutePosition.L)*g_dKoef_mm_to_pix+.5>>0};this.GetCSS_height= +function(){return(this.AbsolutePosition.B-this.AbsolutePosition.T)*g_dKoef_mm_to_pix+.5>>0}}function CControlContainer(){this.Bounds=new CBounds;this.Anchor=g_anchor_left|g_anchor_top;this.Name=null;this.Parent=null;this.TabIndex=null;this.HtmlElement=null;this.AbsolutePosition=new CBounds;this.Controls=[];this.AddControl=function(ctrl){ctrl.Parent=this;this.Controls[this.Controls.length]=ctrl};this.Resize=function(_width,_height,api){if(null==this.Parent){this.AbsolutePosition.L=0;this.AbsolutePosition.T= +0;this.AbsolutePosition.R=_width;this.AbsolutePosition.B=_height;if(null!=this.HtmlElement){var lCount=this.Controls.length;for(var i=0;i>0)+"px";this.HtmlElement.style.top=(_y*g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.width=((_r-_x)* +g_dKoef_mm_to_pix+.5>>0)+"px";this.HtmlElement.style.height=((_b-_y)*g_dKoef_mm_to_pix+.5>>0)+"px";var lCount=this.Controls.length;for(var i=0;i>0};this.GetCSS_height=function(){return(this.AbsolutePosition.B-this.AbsolutePosition.T)*g_dKoef_mm_to_pix+.5>>0}}function CreateControlContainer(name){var ctrl=new CControlContainer;ctrl.Name=name; +ctrl.HtmlElement=document.getElementById(name);return ctrl}function CreateControl(name){var ctrl=new CControl;ctrl.Name=name;ctrl.HtmlElement=document.getElementById(name);return ctrl}window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].g_anchor_left=g_anchor_left;window["AscCommon"].g_anchor_top=g_anchor_top;window["AscCommon"].g_anchor_right=g_anchor_right;window["AscCommon"].g_anchor_bottom=g_anchor_bottom;window["AscCommon"].CreateControlContainer=CreateControlContainer;window["AscCommon"].CreateControl= +CreateControl})(window);"use strict";(function(window,undefined){var AscBrowser=AscCommon.AscBrowser;var TRACK_CIRCLE_RADIUS=5;var TRACK_RECT_SIZE2=4;var TRACK_RECT_SIZE=8;var TRACK_RECT_SIZE_CT=6;var TRACK_DISTANCE_ROTATE=25;var TRACK_DISTANCE_ROTATE2=25;var TRACK_ADJUSTMENT_SIZE=10;var TRACK_WRAPPOINTS_SIZE=6;var IMAGE_ROTATE_TRACK_W=21;var bIsUseImageRotateTrack=true;if(bIsUseImageRotateTrack){window.g_track_rotate_marker=new Image;window.g_track_rotate_marker;window.g_track_rotate_marker.asc_complete= +false;window.g_track_rotate_marker.onload=function(){window.g_track_rotate_marker.asc_complete=true};window.g_track_rotate_marker.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAAVFBMVEUAAAD///////////////////////////////////////////////////////98fHy2trb09PTT09OysrKqqqqJiYng4ODr6+uamprGxsbi4uKGhoYjgM0eAAAADnRSTlMAy00k7/z0jbeuMzDljsugwZgAAACpSURBVBjTdZHbEoMgDESDAl6bgIqX9v//s67UYpm6D0xyYMImoaiuUr3pVdVRUtnwqaY8YaE5SRcfaPgqc+DSIh7WIGGaEVoUqRGN4oZlcDIiqYlaPjQz5CNu6cFJwLiuSO3nlLBDrKhn3l4rcnH4NcAdGd5EZMfCsoMFBxM6CD57G+u6vC48PMVnHtrYhP/x+7+3cw7zdJnD3cyA7QXa4nYXaW+a9Xdvb6zqE5Jb7LmzAAAAAElFTkSuQmCC"; window.g_track_rotate_marker2=new Image;window.g_track_rotate_marker2;window.g_track_rotate_marker2.asc_complete=false;window.g_track_rotate_marker2.onload=function(){window.g_track_rotate_marker2.asc_complete=true};window.g_track_rotate_marker2.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAeFBMVEUAAAD///////////////////////////////////////////////////////////////////////////+Tk5Obm5v8/PzAwMD5+fmWlpbt7e3k5OSfn5/z8/PLy8vn5+fExMSsrKyqqqrf39+vr6+9vb2urq7c3NxSmuRpAAAAE3RSTlMA+u2XA+PTrId4WBwTN7EKtLY4iqQP6AAAAWhJREFUOMudVe2SgjAMLN+goN51CxTLp3r3/m943BAqIJTR/RU6O02yTRY2g5tEgW9blu0HUeKyLRxDj0/ghcdVWuxYfAHLiV95B5uvwD4saK7DN+DMSj1f+CYu58l9J27A6XnnJG9R3ZWU6l4Vk+y6D310baHRXvUxdRSP/aYZILJbmebFLRNAlo69x7PEeQdZ5Xz8qiS6fJr8aOnEquATFApdSsr/v1HINUo+Q6nwoDDspfH4JmoJ6shzWcINaNBSlLCI6uvLfyXmAlR2xIKBB/A1ZKiGIGA+8QCtphBawRt+hsBnNvE0M0OPZmwcijRnFvE0U6CuIcbrIUlJRnJL9L0YifTQCgU3p/aH4I7fnWaCIajwMMszCl5A7Aj+TWctGuMT6qG4QtbGodBj9oAyjpke3LSDYXCXq9A8V6GZrsLGcqXlcrneW9elAQgpxdwA3rcUdv4ymdQHtrdvpPvW/LHZ7/8+/gBTWGFPbAkGiAAAAABJRU5ErkJggg=="; TRACK_DISTANCE_ROTATE2=18}function COverlay(){this.m_oControl=null;this.m_oContext=null;this.min_x=65535;this.min_y=65535;this.max_x=-65535;this.max_y=-65535;this.m_bIsShow=false;this.m_bIsAlwaysUpdateOverlay=false;this.m_oHtmlPage=null;this.DashLineColor="#000000";this.ClearAll=false;this.IsRetina=false;this.IsCellEditor=false}COverlay.prototype={init:function(context,controlName,x,y,w_pix,h_pix,w_mm,h_mm){this.m_oContext=context;this.m_oControl=AscCommon.CreateControl(controlName);this.m_oHtmlPage= new AscCommon.CHtmlPage;this.m_oHtmlPage.init(x,y,w_pix,h_pix,w_mm,h_mm)},Clear:function(){if(null==this.m_oContext){this.m_oContext=this.m_oControl.HtmlElement.getContext("2d");this.m_oContext.imageSmoothingEnabled=false;this.m_oContext.mozImageSmoothingEnabled=false;this.m_oContext.oImageSmoothingEnabled=false;this.m_oContext.webkitImageSmoothingEnabled=false}this.SetBaseTransform();this.m_oContext.beginPath();if(this.max_x!=-65535&&this.max_y!=-65535)if(this.ClearAll===true){this.m_oContext.clearRect(0, diff --git a/www/common/onlyoffice/v4/sdkjs/slide/sdk-all-min.js b/www/common/onlyoffice/v4/sdkjs/slide/sdk-all-min.js index c2762ee40..2c8a6ee54 100644 --- a/www/common/onlyoffice/v4/sdkjs/slide/sdk-all-min.js +++ b/www/common/onlyoffice/v4/sdkjs/slide/sdk-all-min.js @@ -1356,62 +1356,62 @@ prot["Clock_Clockwise"]=c_oAscSlideTransitionParams.Clock_Clockwise;prot["Clock_ prot["EditSelectAll"]=c_oAscPresentationShortcutType.EditSelectAll;prot["EditUndo"]=c_oAscPresentationShortcutType.EditUndo;prot["EditRedo"]=c_oAscPresentationShortcutType.EditRedo;prot["Cut"]=c_oAscPresentationShortcutType.Cut;prot["Copy"]=c_oAscPresentationShortcutType.Copy;prot["Paste"]=c_oAscPresentationShortcutType.Paste;prot["Duplicate"]=c_oAscPresentationShortcutType.Duplicate;prot["Print"]=c_oAscPresentationShortcutType.Print;prot["Save"]=c_oAscPresentationShortcutType.Save; prot["ShowContextMenu"]=c_oAscPresentationShortcutType.ShowContextMenu;window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].c_oSerFormat=c_oSerFormat;window["AscCommon"].CurFileVersion=c_oSerFormat.Version;"use strict"; (function(window,undefined){var FOREIGN_CURSOR_LABEL_HIDETIME=1500;function CCollaborativeChanges(){this.m_pData=null;this.m_oColor=null}CCollaborativeChanges.prototype.Set_Data=function(pData){this.m_pData=pData};CCollaborativeChanges.prototype.Set_Color=function(oColor){this.m_oColor=oColor};CCollaborativeChanges.prototype.Set_FromUndoRedo=function(Class,Data,Binary){if(!Class.Get_Id)return false;this.m_pData=this.private_SaveData(Binary);return true};CCollaborativeChanges.prototype.Apply_Data= -function(){var CollaborativeEditing=AscCommon.CollaborativeEditing;var Reader=this.private_LoadData(this.m_pData);var ClassId=Reader.GetString2();var Class=AscCommon.g_oTableId.Get_ById(ClassId);if(!Class)return false;var nReaderPos=Reader.GetCurPos();var nChangesType=Reader.GetLong();var fChangesClass=AscDFH.changesFactory[nChangesType];if(fChangesClass){var oChange=new fChangesClass(Class);oChange.ReadFromBinary(Reader);if(true===CollaborativeEditing.private_AddOverallChange(oChange))oChange.Load(this.m_oColor); -return true}else{CollaborativeEditing.private_AddOverallChange(this.m_pData);Reader.Seek2(nReaderPos);if(!Class.Load_Changes)return false;return Class.Load_Changes(Reader,null,this.m_oColor)}};CCollaborativeChanges.prototype.private_LoadData=function(szSrc){return this.GetStream(szSrc,0,szSrc.length)};CCollaborativeChanges.prototype.GetStream=function(szSrc,offset,srcLen){var nWritten=0;var index=-1+offset;var dst_len="";while(true){index++;var _c=szSrc.charCodeAt(index);if(_c==";".charCodeAt(0)){index++; -break}dst_len+=String.fromCharCode(_c)}var dstLen=parseInt(dst_len);var pointer=AscFonts.g_memory.Alloc(dstLen);var stream=new AscCommon.FT_Stream2(pointer.data,dstLen);stream.obj=pointer.obj;var dstPx=stream.data;if(window.chrome)while(index=srcLen)break;var nCh=AscFonts.DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i>>16;dwCurr<<=8}}else{var p=AscFonts.b64_decode;while(index=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i>>16;dwCurr<<=8}}}return stream};CCollaborativeChanges.prototype.private_SaveData=function(Binary){var Writer=AscCommon.History.BinaryWriter;var Pos=Binary.Pos;var Len=Binary.Len; -return Len+";"+Writer.GetBase64Memory2(Pos,Len)};function CCollaborativeEditingBase(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_bGlobalLock=0;this.m_bGlobalLockSelection=0;this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[];this.m_aDC={};this.m_aChangedClasses={};this.m_oMemory=null;this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId= -{};this.m_bFast=false;this.m_oLogicDocument=null;this.m_aDocumentPositions=new CDocumentPositionsManager;this.m_aForeignCursorsPos=new CDocumentPositionsManager;this.m_aForeignCursors={};this.m_aForeignCursorsId={};this.m_nAllChangesSavedIndex=0;this.m_aAllChanges=[];this.m_aOwnChangesIndexes=[];this.m_oOwnChanges=[]}CCollaborativeEditingBase.prototype.Clear=function(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData= -[];this.m_aEndActions=[];this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[]};CCollaborativeEditingBase.prototype.Set_Fast=function(bFast){this.m_bFast=bFast;if(false===bFast){this.Remove_AllForeignCursors();this.RemoveMyCursorFromOthers()}};CCollaborativeEditingBase.prototype.Is_Fast=function(){return this.m_bFast};CCollaborativeEditingBase.prototype.Is_SingleUser=function(){return 1===this.m_nUseType};CCollaborativeEditingBase.prototype.getCollaborativeEditing= -function(){return!this.Is_SingleUser()};CCollaborativeEditingBase.prototype.Start_CollaborationEditing=function(){this.m_nUseType=-1};CCollaborativeEditingBase.prototype.End_CollaborationEditing=function(){if(this.m_nUseType<=0)this.m_nUseType=0};CCollaborativeEditingBase.prototype.Add_User=function(UserId){if(-1===this.Find_User(UserId))this.m_aUsers.push(UserId)};CCollaborativeEditingBase.prototype.Find_User=function(UserId){var Len=this.m_aUsers.length;for(var Index=0;Index0;if(true===OtherChanges){AscFonts.IsCheckSymbols=true;editor.WordControl.m_oLogicDocument.StopRecalculate();editor.WordControl.m_oLogicDocument.EndPreview_MailMergeResult();editor.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.ApplyChanges);var DocState=this.private_SaveDocumentState();this.Clear_NewImages();this.Apply_OtherChanges(); -this.Lock_NeedLock();this.private_RestoreDocumentState(DocState);this.OnStart_Load_Objects();AscFonts.IsCheckSymbols=false}};CCollaborativeEditingBase.prototype.Apply_OtherChanges=function(){AscCommon.g_oIdCounter.Set_Load(true);if(this.m_aChanges.length>0)this.private_CollectOwnChanges();var _count=this.m_aChanges.length;for(var i=0;i<_count;i++){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;var Changes=this.m_aChanges[i]; -Changes.Apply_Data()}this.private_ClearChanges();this.Apply_LinkData();this.Check_MergeData();this.OnEnd_ReadForeignChanges();AscCommon.g_oIdCounter.Set_Load(false)};CCollaborativeEditingBase.prototype.getOwnLocksLength=function(){return this.m_aNeedUnlock2.length};CCollaborativeEditingBase.prototype.Send_Changes=function(){};CCollaborativeEditingBase.prototype.Release_Locks=function(){};CCollaborativeEditingBase.prototype.CheckWaitingImages=function(aImages){};CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges= -function(aImages){var rData={},oApi=editor||Asc["editor"],i;if(!oApi)return;rData["c"]="pathurls";rData["data"]=[];for(i=0;i0)this.SendImagesUrlsFromChanges(aImages);else{this.SendImagesCallback([].concat(this.m_aNewImages));this.m_aNewImages.length=0}};CCollaborativeEditingBase.prototype.OnEnd_Load_Objects=function(){};CCollaborativeEditingBase.prototype.Clear_LinkData=function(){this.m_aLinkData.length=0};CCollaborativeEditingBase.prototype.Add_LinkData=function(Class,LinkData){this.m_aLinkData.push({Class:Class,LinkData:LinkData})}; -CCollaborativeEditingBase.prototype.Apply_LinkData=function(){var Count=this.m_aLinkData.length;for(var Index=0;Index -0){this.m_aOwnChangesIndexes.push({Position:this.m_aAllChanges.length,Count:arrChanges.length});this.m_aAllChanges=this.m_aAllChanges.concat(arrChanges)}};CCollaborativeEditingBase.prototype.Undo=function(){if(true===this.Get_GlobalLock())return;if(this.m_aOwnChangesIndexes.length<=0)return false;var arrChanges=[];var oIndexes=this.m_aOwnChangesIndexes[this.m_aOwnChangesIndexes.length-1];var nPosition=oIndexes.Position;var nCount=oIndexes.Count;for(var nIndex=nCount-1;nIndex>=0;--nIndex){var oChange= -this.m_aAllChanges[nPosition+nIndex];if(!oChange)continue;var oClass=oChange.GetClass();if(oChange.IsContentChange()){var _oChange=oChange.Copy();if(this.private_CommutateContentChanges(_oChange,nPosition+nCount))arrChanges.push(_oChange);oChange.SetReverted(true)}else{var _oChange=oChange;if(this.private_CommutatePropertyChanges(oClass,_oChange,nPosition+nCount))arrChanges.push(_oChange)}}this.m_aOwnChangesIndexes.length=this.m_aOwnChangesIndexes.length-1;var arrReverseChanges=[];for(var nIndex= -0,nCount=arrChanges.length;nIndex-1;--i)if(mapAddedSlides[oLogicDocument.Slides[i].Get_Id()]&&!oLogicDocument.Slides[i].Layout)oLogicDocument.removeSlide(i);for(var sId in mapSlides)if(mapSlides.hasOwnProperty(sId))mapSlides[sId].correctContent();if(bChangedLayout)for(var i=oLogicDocument.Slides.length-1;i>-1;--i){var Layout= -oLogicDocument.Slides[i].Layout;if(!Layout||mapLayouts[Layout.Get_Id()])if(!oLogicDocument.Slides[i].CheckLayout())oLogicDocument.removeSlide(i)}for(var sId in mapGrObjects){var oShape=mapGrObjects[sId];if(!oShape.checkCorrect()){oShape.setBDeleted(true);if(oShape.group)oShape.group.removeFromSpTree(oShape.Get_Id());else if(AscFormat.Slide&&oShape.parent instanceof AscFormat.Slide)oShape.parent.removeFromSpTreeById(oShape.Get_Id());else if(AscCommonWord.ParaDrawing&&oShape.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oShape.parent.Get_Id()]= -oShape.parent}else if(oShape.resetGroups)oShape.resetGroups()}var oDrawing;for(var sId in mapDrawings)if(mapDrawings.hasOwnProperty(sId)){oDrawing=mapDrawings[sId];if(!oDrawing.CheckCorrect()){var oParentParagraph=oDrawing.Get_ParentParagraph();oDrawing.PreDelete();oDrawing.Remove_FromDocument(false);if(oParentParagraph)mapParagraphs[oParentParagraph.Get_Id()]=oParentParagraph}}for(var sId in mapRuns)if(mapRuns.hasOwnProperty(sId)){var oRun=mapRuns[sId];for(var nIndex=oRun.Content.length-1;nIndex> --1;--nIndex)if(oRun.Content[nIndex]instanceof AscCommonWord.ParaDrawing)if(!oRun.Content[nIndex].CheckCorrect()){oRun.Remove_FromContent(nIndex,1,false);if(oRun.Paragraph)mapParagraphs[oRun.Paragraph.Get_Id()]=oRun.Paragraph}}for(var sId in mapTables){var oTable=mapTables[sId];for(var nCurRow=oTable.Content.length-1;nCurRow>=0;--nCurRow){var oRow=oTable.Get_Row(nCurRow);if(oRow.Get_CellsCount()<=0)oTable.private_RemoveRow(nCurRow)}if(oTable.Parent instanceof AscCommonWord.CDocument||oTable.Parent instanceof -AscCommonWord.CDocumentContent)mapDocumentContents[oTable.Parent.Get_Id()]=oTable.Parent}for(var sId in mapDocumentContents){var oDocumentContent=mapDocumentContents[sId];var nContentLen=oDocumentContent.Content.length;for(var nIndex=nContentLen-1;nIndex>=0;--nIndex){var oElement=oDocumentContent.Content[nIndex];if((AscCommonWord.type_Paragraph===oElement.GetType()||AscCommonWord.type_Table===oElement.GetType())&&oElement.Content.length<=0)oDocumentContent.Remove_FromContent(nIndex,1)}nContentLen= -oDocumentContent.Content.length;if(nContentLen<=0||AscCommonWord.type_Paragraph!==oDocumentContent.Content[nContentLen-1].GetType()){var oNewParagraph=new AscCommonWord.Paragraph(oLogicDocument.Get_DrawingDocument(),oDocumentContent,0,0,0,0,0,false);oDocumentContent.Add_ToContent(nContentLen,oNewParagraph)}}for(var sId in mapParagraphs){var oParagraph=mapParagraphs[sId];oParagraph.CheckParaEnd();oParagraph.Correct_Content(null,null,true)}var oBinaryWriter=AscCommon.History.BinaryWriter;var aSendingChanges= -[];for(var nIndex=0,nCount=arrReverseChanges.length;nIndex=0;--nActionIndex){var oAction=arrActions[nActionIndex];var oResult=oAction;for(var nIndex=nStartPosition,nOverallCount=this.m_aAllChanges.length;nIndex=srcLen)break;var nCh=AscFonts.DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i>>16;dwCurr<<=8}}else{var p=AscFonts.b64_decode;while(index=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i= +0;i>>16;dwCurr<<=8}}}return stream};CCollaborativeChanges.prototype.private_SaveData=function(Binary){var Writer=AscCommon.History.BinaryWriter;var Pos=Binary.Pos;var Len=Binary.Len;return Len+";"+Writer.GetBase64Memory2(Pos,Len)};function CCollaborativeEditingBase(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_bGlobalLock=0;this.m_bGlobalLockSelection= +0;this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[];this.m_aDC={};this.m_aChangedClasses={};this.m_oMemory=null;this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId={};this.m_bFast=false;this.m_oLogicDocument=null;this.m_aDocumentPositions=new CDocumentPositionsManager;this.m_aForeignCursorsPos=new CDocumentPositionsManager;this.m_aForeignCursors={};this.m_aForeignCursorsId={};this.m_nAllChangesSavedIndex=0;this.m_aAllChanges=[];this.m_aOwnChangesIndexes= +[];this.m_oOwnChanges=[]}CCollaborativeEditingBase.prototype.Clear=function(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[]};CCollaborativeEditingBase.prototype.Set_Fast=function(bFast){this.m_bFast=bFast;if(false===bFast){this.Remove_AllForeignCursors();this.RemoveMyCursorFromOthers()}};CCollaborativeEditingBase.prototype.Is_Fast= +function(){return this.m_bFast};CCollaborativeEditingBase.prototype.Is_SingleUser=function(){return 1===this.m_nUseType};CCollaborativeEditingBase.prototype.getCollaborativeEditing=function(){return!this.Is_SingleUser()};CCollaborativeEditingBase.prototype.Start_CollaborationEditing=function(){this.m_nUseType=-1};CCollaborativeEditingBase.prototype.End_CollaborationEditing=function(){if(this.m_nUseType<=0)this.m_nUseType=0};CCollaborativeEditingBase.prototype.Add_User=function(UserId){if(-1===this.Find_User(UserId))this.m_aUsers.push(UserId)}; +CCollaborativeEditingBase.prototype.Find_User=function(UserId){var Len=this.m_aUsers.length;for(var Index=0;Index0;if(true===OtherChanges){AscFonts.IsCheckSymbols=true;editor.WordControl.m_oLogicDocument.StopRecalculate();editor.WordControl.m_oLogicDocument.EndPreview_MailMergeResult(); +editor.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.ApplyChanges);var DocState=this.private_SaveDocumentState();this.Clear_NewImages();this.Apply_OtherChanges();this.Lock_NeedLock();this.private_RestoreDocumentState(DocState);this.OnStart_Load_Objects();AscFonts.IsCheckSymbols=false}};CCollaborativeEditingBase.prototype.Apply_OtherChanges=function(){AscCommon.g_oIdCounter.Set_Load(true);if(this.m_aChanges.length>0)this.private_CollectOwnChanges();var _count=this.m_aChanges.length; +for(var i=0;i<_count;i++){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;var Changes=this.m_aChanges[i];Changes.Apply_Data()}this.private_ClearChanges();this.Apply_LinkData();this.Check_MergeData();this.OnEnd_ReadForeignChanges();AscCommon.g_oIdCounter.Set_Load(false)};CCollaborativeEditingBase.prototype.getOwnLocksLength=function(){return this.m_aNeedUnlock2.length};CCollaborativeEditingBase.prototype.Send_Changes=function(){}; +CCollaborativeEditingBase.prototype.Release_Locks=function(){};CCollaborativeEditingBase.prototype.CheckWaitingImages=function(aImages){};CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges=function(aImages){var rData={},oApi=editor||Asc["editor"],i;if(!oApi)return;rData["c"]="pathurls";rData["data"]=[];for(i=0;i0)this.SendImagesUrlsFromChanges(aImages);else{this.SendImagesCallback([].concat(this.m_aNewImages));this.m_aNewImages.length=0}};CCollaborativeEditingBase.prototype.OnEnd_Load_Objects=function(){};CCollaborativeEditingBase.prototype.Clear_LinkData=function(){this.m_aLinkData.length=0};CCollaborativeEditingBase.prototype.Add_LinkData= +function(Class,LinkData){this.m_aLinkData.push({Class:Class,LinkData:LinkData})};CCollaborativeEditingBase.prototype.Apply_LinkData=function(){var Count=this.m_aLinkData.length;for(var Index=0;Index0){this.m_aOwnChangesIndexes.push({Position:this.m_aAllChanges.length,Count:arrChanges.length});this.m_aAllChanges=this.m_aAllChanges.concat(arrChanges)}};CCollaborativeEditingBase.prototype.Undo=function(){if(true===this.Get_GlobalLock())return;if(this.m_aOwnChangesIndexes.length<=0)return false;var arrChanges=[];var oIndexes=this.m_aOwnChangesIndexes[this.m_aOwnChangesIndexes.length- +1];var nPosition=oIndexes.Position;var nCount=oIndexes.Count;for(var nIndex=nCount-1;nIndex>=0;--nIndex){var oChange=this.m_aAllChanges[nPosition+nIndex];if(!oChange)continue;var oClass=oChange.GetClass();if(oChange.IsContentChange()){var _oChange=oChange.Copy();if(this.private_CommutateContentChanges(_oChange,nPosition+nCount))arrChanges.push(_oChange);oChange.SetReverted(true)}else{var _oChange=oChange;if(this.private_CommutatePropertyChanges(oClass,_oChange,nPosition+nCount))arrChanges.push(_oChange)}}this.m_aOwnChangesIndexes.length= +this.m_aOwnChangesIndexes.length-1;var arrReverseChanges=[];for(var nIndex=0,nCount=arrChanges.length;nIndex-1;--i)if(mapAddedSlides[oLogicDocument.Slides[i].Get_Id()]&&!oLogicDocument.Slides[i].Layout)oLogicDocument.removeSlide(i);for(var sId in mapSlides)if(mapSlides.hasOwnProperty(sId))mapSlides[sId].correctContent(); +if(bChangedLayout)for(var i=oLogicDocument.Slides.length-1;i>-1;--i){var Layout=oLogicDocument.Slides[i].Layout;if(!Layout||mapLayouts[Layout.Get_Id()])if(!oLogicDocument.Slides[i].CheckLayout())oLogicDocument.removeSlide(i)}for(var sId in mapGrObjects){var oShape=mapGrObjects[sId];if(!oShape.checkCorrect()){oShape.setBDeleted(true);if(oShape.group)oShape.group.removeFromSpTree(oShape.Get_Id());else if(AscFormat.Slide&&oShape.parent instanceof AscFormat.Slide)oShape.parent.removeFromSpTreeById(oShape.Get_Id()); +else if(AscCommonWord.ParaDrawing&&oShape.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oShape.parent.Get_Id()]=oShape.parent}else if(oShape.resetGroups)oShape.resetGroups()}var oDrawing;for(var sId in mapDrawings)if(mapDrawings.hasOwnProperty(sId)){oDrawing=mapDrawings[sId];if(!oDrawing.CheckCorrect()){var oParentParagraph=oDrawing.Get_ParentParagraph();oDrawing.PreDelete();oDrawing.Remove_FromDocument(false);if(oParentParagraph)mapParagraphs[oParentParagraph.Get_Id()]=oParentParagraph}}for(var sId in mapRuns)if(mapRuns.hasOwnProperty(sId)){var oRun= +mapRuns[sId];for(var nIndex=oRun.Content.length-1;nIndex>-1;--nIndex)if(oRun.Content[nIndex]instanceof AscCommonWord.ParaDrawing)if(!oRun.Content[nIndex].CheckCorrect()){oRun.Remove_FromContent(nIndex,1,false);if(oRun.Paragraph)mapParagraphs[oRun.Paragraph.Get_Id()]=oRun.Paragraph}}for(var sId in mapTables){var oTable=mapTables[sId];for(var nCurRow=oTable.Content.length-1;nCurRow>=0;--nCurRow){var oRow=oTable.Get_Row(nCurRow);if(oRow.Get_CellsCount()<=0)oTable.private_RemoveRow(nCurRow)}if(oTable.Parent instanceof +AscCommonWord.CDocument||oTable.Parent instanceof AscCommonWord.CDocumentContent)mapDocumentContents[oTable.Parent.Get_Id()]=oTable.Parent}for(var sId in mapDocumentContents){var oDocumentContent=mapDocumentContents[sId];var nContentLen=oDocumentContent.Content.length;for(var nIndex=nContentLen-1;nIndex>=0;--nIndex){var oElement=oDocumentContent.Content[nIndex];if((AscCommonWord.type_Paragraph===oElement.GetType()||AscCommonWord.type_Table===oElement.GetType())&&oElement.Content.length<=0)oDocumentContent.Remove_FromContent(nIndex, +1)}nContentLen=oDocumentContent.Content.length;if(nContentLen<=0||AscCommonWord.type_Paragraph!==oDocumentContent.Content[nContentLen-1].GetType()){var oNewParagraph=new AscCommonWord.Paragraph(oLogicDocument.Get_DrawingDocument(),oDocumentContent,0,0,0,0,0,false);oDocumentContent.Add_ToContent(nContentLen,oNewParagraph)}}for(var sId in mapParagraphs){var oParagraph=mapParagraphs[sId];oParagraph.CheckParaEnd();oParagraph.Correct_Content(null,null,true)}var oBinaryWriter=AscCommon.History.BinaryWriter; +var aSendingChanges=[];for(var nIndex=0,nCount=arrReverseChanges.length;nIndex=0;--nActionIndex){var oAction=arrActions[nActionIndex];var oResult=oAction;for(var nIndex=nStartPosition,nOverallCount= +this.m_aAllChanges.length;nIndex0)oChange.ConvertFromSimpleActions(arrCommutateActions);else return false;return true};CCollaborativeEditingBase.prototype.private_Commutate=function(oActionL,oActionR){if(oActionL.Add)if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;else oActionR.Pos--;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else if(oActionL.Pos===oActionR.Pos)return false;else oActionR.Pos--;else if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++; else oActionR.Pos++;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else oActionR.Pos++;return true};CCollaborativeEditingBase.prototype.private_CommutatePropertyChanges=function(oClass,oChange,nStartPosition){if(oChange.CheckCorrect&&!oChange.CheckCorrect())return false;return true};CCollaborativeEditingBase.prototype.private_RecalculateDocument=function(oRecalcData){};function CDocumentPositionsManager(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap= []}CDocumentPositionsManager.prototype.Clear_DocumentPositions=function(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=[]};CDocumentPositionsManager.prototype.Add_DocumentPosition=function(Position){this.m_aDocumentPositions.push(Position)};CDocumentPositionsManager.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex=0&&slideNum=srcLen)break;var nCh=AscFonts.DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i>>16;dwCurr<<=8}}else{var p=AscFonts.b64_decode;while(index=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i>>16;dwCurr<<=8}}}return stream};CCollaborativeChanges.prototype.private_SaveData=function(Binary){var Writer=AscCommon.History.BinaryWriter;var Pos=Binary.Pos;var Len=Binary.Len; -return Len+";"+Writer.GetBase64Memory2(Pos,Len)};function CCollaborativeEditingBase(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_bGlobalLock=0;this.m_bGlobalLockSelection=0;this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[];this.m_aDC={};this.m_aChangedClasses={};this.m_oMemory=null;this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId= -{};this.m_bFast=false;this.m_oLogicDocument=null;this.m_aDocumentPositions=new CDocumentPositionsManager;this.m_aForeignCursorsPos=new CDocumentPositionsManager;this.m_aForeignCursors={};this.m_aForeignCursorsId={};this.m_nAllChangesSavedIndex=0;this.m_aAllChanges=[];this.m_aOwnChangesIndexes=[];this.m_oOwnChanges=[]}CCollaborativeEditingBase.prototype.Clear=function(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData= -[];this.m_aEndActions=[];this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[]};CCollaborativeEditingBase.prototype.Set_Fast=function(bFast){this.m_bFast=bFast;if(false===bFast){this.Remove_AllForeignCursors();this.RemoveMyCursorFromOthers()}};CCollaborativeEditingBase.prototype.Is_Fast=function(){return this.m_bFast};CCollaborativeEditingBase.prototype.Is_SingleUser=function(){return 1===this.m_nUseType};CCollaborativeEditingBase.prototype.getCollaborativeEditing= -function(){return!this.Is_SingleUser()};CCollaborativeEditingBase.prototype.Start_CollaborationEditing=function(){this.m_nUseType=-1};CCollaborativeEditingBase.prototype.End_CollaborationEditing=function(){if(this.m_nUseType<=0)this.m_nUseType=0};CCollaborativeEditingBase.prototype.Add_User=function(UserId){if(-1===this.Find_User(UserId))this.m_aUsers.push(UserId)};CCollaborativeEditingBase.prototype.Find_User=function(UserId){var Len=this.m_aUsers.length;for(var Index=0;Index0;if(true===OtherChanges){AscFonts.IsCheckSymbols=true;editor.WordControl.m_oLogicDocument.StopRecalculate();editor.WordControl.m_oLogicDocument.EndPreview_MailMergeResult();editor.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.ApplyChanges);var DocState=this.private_SaveDocumentState();this.Clear_NewImages();this.Apply_OtherChanges(); -this.Lock_NeedLock();this.private_RestoreDocumentState(DocState);this.OnStart_Load_Objects();AscFonts.IsCheckSymbols=false}};CCollaborativeEditingBase.prototype.Apply_OtherChanges=function(){AscCommon.g_oIdCounter.Set_Load(true);if(this.m_aChanges.length>0)this.private_CollectOwnChanges();var _count=this.m_aChanges.length;for(var i=0;i<_count;i++){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;var Changes=this.m_aChanges[i]; -Changes.Apply_Data()}this.private_ClearChanges();this.Apply_LinkData();this.Check_MergeData();this.OnEnd_ReadForeignChanges();AscCommon.g_oIdCounter.Set_Load(false)};CCollaborativeEditingBase.prototype.getOwnLocksLength=function(){return this.m_aNeedUnlock2.length};CCollaborativeEditingBase.prototype.Send_Changes=function(){};CCollaborativeEditingBase.prototype.Release_Locks=function(){};CCollaborativeEditingBase.prototype.CheckWaitingImages=function(aImages){};CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges= -function(aImages){var rData={},oApi=editor||Asc["editor"],i;if(!oApi)return;rData["c"]="pathurls";rData["data"]=[];for(i=0;i0)this.SendImagesUrlsFromChanges(aImages);else{this.SendImagesCallback([].concat(this.m_aNewImages));this.m_aNewImages.length=0}};CCollaborativeEditingBase.prototype.OnEnd_Load_Objects=function(){};CCollaborativeEditingBase.prototype.Clear_LinkData=function(){this.m_aLinkData.length=0};CCollaborativeEditingBase.prototype.Add_LinkData=function(Class,LinkData){this.m_aLinkData.push({Class:Class,LinkData:LinkData})}; -CCollaborativeEditingBase.prototype.Apply_LinkData=function(){var Count=this.m_aLinkData.length;for(var Index=0;Index -0){this.m_aOwnChangesIndexes.push({Position:this.m_aAllChanges.length,Count:arrChanges.length});this.m_aAllChanges=this.m_aAllChanges.concat(arrChanges)}};CCollaborativeEditingBase.prototype.Undo=function(){if(true===this.Get_GlobalLock())return;if(this.m_aOwnChangesIndexes.length<=0)return false;var arrChanges=[];var oIndexes=this.m_aOwnChangesIndexes[this.m_aOwnChangesIndexes.length-1];var nPosition=oIndexes.Position;var nCount=oIndexes.Count;for(var nIndex=nCount-1;nIndex>=0;--nIndex){var oChange= -this.m_aAllChanges[nPosition+nIndex];if(!oChange)continue;var oClass=oChange.GetClass();if(oChange.IsContentChange()){var _oChange=oChange.Copy();if(this.private_CommutateContentChanges(_oChange,nPosition+nCount))arrChanges.push(_oChange);oChange.SetReverted(true)}else{var _oChange=oChange;if(this.private_CommutatePropertyChanges(oClass,_oChange,nPosition+nCount))arrChanges.push(_oChange)}}this.m_aOwnChangesIndexes.length=this.m_aOwnChangesIndexes.length-1;var arrReverseChanges=[];for(var nIndex= -0,nCount=arrChanges.length;nIndex-1;--i)if(mapAddedSlides[oLogicDocument.Slides[i].Get_Id()]&&!oLogicDocument.Slides[i].Layout)oLogicDocument.removeSlide(i);for(var sId in mapSlides)if(mapSlides.hasOwnProperty(sId))mapSlides[sId].correctContent();if(bChangedLayout)for(var i=oLogicDocument.Slides.length-1;i>-1;--i){var Layout= -oLogicDocument.Slides[i].Layout;if(!Layout||mapLayouts[Layout.Get_Id()])if(!oLogicDocument.Slides[i].CheckLayout())oLogicDocument.removeSlide(i)}for(var sId in mapGrObjects){var oShape=mapGrObjects[sId];if(!oShape.checkCorrect()){oShape.setBDeleted(true);if(oShape.group)oShape.group.removeFromSpTree(oShape.Get_Id());else if(AscFormat.Slide&&oShape.parent instanceof AscFormat.Slide)oShape.parent.removeFromSpTreeById(oShape.Get_Id());else if(AscCommonWord.ParaDrawing&&oShape.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oShape.parent.Get_Id()]= -oShape.parent}else if(oShape.resetGroups)oShape.resetGroups()}var oDrawing;for(var sId in mapDrawings)if(mapDrawings.hasOwnProperty(sId)){oDrawing=mapDrawings[sId];if(!oDrawing.CheckCorrect()){var oParentParagraph=oDrawing.Get_ParentParagraph();oDrawing.PreDelete();oDrawing.Remove_FromDocument(false);if(oParentParagraph)mapParagraphs[oParentParagraph.Get_Id()]=oParentParagraph}}for(var sId in mapRuns)if(mapRuns.hasOwnProperty(sId)){var oRun=mapRuns[sId];for(var nIndex=oRun.Content.length-1;nIndex> --1;--nIndex)if(oRun.Content[nIndex]instanceof AscCommonWord.ParaDrawing)if(!oRun.Content[nIndex].CheckCorrect()){oRun.Remove_FromContent(nIndex,1,false);if(oRun.Paragraph)mapParagraphs[oRun.Paragraph.Get_Id()]=oRun.Paragraph}}for(var sId in mapTables){var oTable=mapTables[sId];for(var nCurRow=oTable.Content.length-1;nCurRow>=0;--nCurRow){var oRow=oTable.Get_Row(nCurRow);if(oRow.Get_CellsCount()<=0)oTable.private_RemoveRow(nCurRow)}if(oTable.Parent instanceof AscCommonWord.CDocument||oTable.Parent instanceof -AscCommonWord.CDocumentContent)mapDocumentContents[oTable.Parent.Get_Id()]=oTable.Parent}for(var sId in mapDocumentContents){var oDocumentContent=mapDocumentContents[sId];var nContentLen=oDocumentContent.Content.length;for(var nIndex=nContentLen-1;nIndex>=0;--nIndex){var oElement=oDocumentContent.Content[nIndex];if((AscCommonWord.type_Paragraph===oElement.GetType()||AscCommonWord.type_Table===oElement.GetType())&&oElement.Content.length<=0)oDocumentContent.Remove_FromContent(nIndex,1)}nContentLen= -oDocumentContent.Content.length;if(nContentLen<=0||AscCommonWord.type_Paragraph!==oDocumentContent.Content[nContentLen-1].GetType()){var oNewParagraph=new AscCommonWord.Paragraph(oLogicDocument.Get_DrawingDocument(),oDocumentContent,0,0,0,0,0,false);oDocumentContent.Add_ToContent(nContentLen,oNewParagraph)}}for(var sId in mapParagraphs){var oParagraph=mapParagraphs[sId];oParagraph.CheckParaEnd();oParagraph.Correct_Content(null,null,true)}var oBinaryWriter=AscCommon.History.BinaryWriter;var aSendingChanges= -[];for(var nIndex=0,nCount=arrReverseChanges.length;nIndex=0;--nActionIndex){var oAction=arrActions[nActionIndex];var oResult=oAction;for(var nIndex=nStartPosition,nOverallCount=this.m_aAllChanges.length;nIndex=srcLen)break;var nCh=AscFonts.DecodeBase64Char(szSrc.charCodeAt(index++));if(nCh==-1){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i=0;i>>16;dwCurr<<=8}}else{var p=AscFonts.b64_decode;while(index=srcLen)break;var nCh=p[szSrc.charCodeAt(index++)];if(nCh==undefined){i--;continue}dwCurr<<=6;dwCurr|=nCh;nBits+=6}dwCurr<<=24-nBits;for(i= +0;i>>16;dwCurr<<=8}}}return stream};CCollaborativeChanges.prototype.private_SaveData=function(Binary){var Writer=AscCommon.History.BinaryWriter;var Pos=Binary.Pos;var Len=Binary.Len;return Len+";"+Writer.GetBase64Memory2(Pos,Len)};function CCollaborativeEditingBase(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_bGlobalLock=0;this.m_bGlobalLockSelection= +0;this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[];this.m_aDC={};this.m_aChangedClasses={};this.m_oMemory=null;this.m_aCursorsToUpdate={};this.m_aCursorsToUpdateShortId={};this.m_bFast=false;this.m_oLogicDocument=null;this.m_aDocumentPositions=new CDocumentPositionsManager;this.m_aForeignCursorsPos=new CDocumentPositionsManager;this.m_aForeignCursors={};this.m_aForeignCursorsId={};this.m_nAllChangesSavedIndex=0;this.m_aAllChanges=[];this.m_aOwnChangesIndexes= +[];this.m_oOwnChanges=[]}CCollaborativeEditingBase.prototype.Clear=function(){this.m_nUseType=1;this.m_aUsers=[];this.m_aChanges=[];this.m_aNeedUnlock=[];this.m_aNeedUnlock2=[];this.m_aNeedLock=[];this.m_aLinkData=[];this.m_aEndActions=[];this.m_aCheckLocks=[];this.m_aCheckLocksInstance=[];this.m_aNewObjects=[];this.m_aNewImages=[]};CCollaborativeEditingBase.prototype.Set_Fast=function(bFast){this.m_bFast=bFast;if(false===bFast){this.Remove_AllForeignCursors();this.RemoveMyCursorFromOthers()}};CCollaborativeEditingBase.prototype.Is_Fast= +function(){return this.m_bFast};CCollaborativeEditingBase.prototype.Is_SingleUser=function(){return 1===this.m_nUseType};CCollaborativeEditingBase.prototype.getCollaborativeEditing=function(){return!this.Is_SingleUser()};CCollaborativeEditingBase.prototype.Start_CollaborationEditing=function(){this.m_nUseType=-1};CCollaborativeEditingBase.prototype.End_CollaborationEditing=function(){if(this.m_nUseType<=0)this.m_nUseType=0};CCollaborativeEditingBase.prototype.Add_User=function(UserId){if(-1===this.Find_User(UserId))this.m_aUsers.push(UserId)}; +CCollaborativeEditingBase.prototype.Find_User=function(UserId){var Len=this.m_aUsers.length;for(var Index=0;Index0;if(true===OtherChanges){AscFonts.IsCheckSymbols=true;editor.WordControl.m_oLogicDocument.StopRecalculate();editor.WordControl.m_oLogicDocument.EndPreview_MailMergeResult(); +editor.sync_StartAction(Asc.c_oAscAsyncActionType.BlockInteraction,Asc.c_oAscAsyncAction.ApplyChanges);var DocState=this.private_SaveDocumentState();this.Clear_NewImages();this.Apply_OtherChanges();this.Lock_NeedLock();this.private_RestoreDocumentState(DocState);this.OnStart_Load_Objects();AscFonts.IsCheckSymbols=false}};CCollaborativeEditingBase.prototype.Apply_OtherChanges=function(){AscCommon.g_oIdCounter.Set_Load(true);if(this.m_aChanges.length>0)this.private_CollectOwnChanges();var _count=this.m_aChanges.length; +for(var i=0;i<_count;i++){if(window["NATIVE_EDITOR_ENJINE"]===true&&window["native"]["CheckNextChange"])if(!window["native"]["CheckNextChange"]())break;var Changes=this.m_aChanges[i];Changes.Apply_Data()}this.private_ClearChanges();this.Apply_LinkData();this.Check_MergeData();this.OnEnd_ReadForeignChanges();AscCommon.g_oIdCounter.Set_Load(false)};CCollaborativeEditingBase.prototype.getOwnLocksLength=function(){return this.m_aNeedUnlock2.length};CCollaborativeEditingBase.prototype.Send_Changes=function(){}; +CCollaborativeEditingBase.prototype.Release_Locks=function(){};CCollaborativeEditingBase.prototype.CheckWaitingImages=function(aImages){};CCollaborativeEditingBase.prototype.SendImagesUrlsFromChanges=function(aImages){var rData={},oApi=editor||Asc["editor"],i;if(!oApi)return;rData["c"]="pathurls";rData["data"]=[];for(i=0;i0)this.SendImagesUrlsFromChanges(aImages);else{this.SendImagesCallback([].concat(this.m_aNewImages));this.m_aNewImages.length=0}};CCollaborativeEditingBase.prototype.OnEnd_Load_Objects=function(){};CCollaborativeEditingBase.prototype.Clear_LinkData=function(){this.m_aLinkData.length=0};CCollaborativeEditingBase.prototype.Add_LinkData= +function(Class,LinkData){this.m_aLinkData.push({Class:Class,LinkData:LinkData})};CCollaborativeEditingBase.prototype.Apply_LinkData=function(){var Count=this.m_aLinkData.length;for(var Index=0;Index0){this.m_aOwnChangesIndexes.push({Position:this.m_aAllChanges.length,Count:arrChanges.length});this.m_aAllChanges=this.m_aAllChanges.concat(arrChanges)}};CCollaborativeEditingBase.prototype.Undo=function(){if(true===this.Get_GlobalLock())return;if(this.m_aOwnChangesIndexes.length<=0)return false;var arrChanges=[];var oIndexes=this.m_aOwnChangesIndexes[this.m_aOwnChangesIndexes.length- +1];var nPosition=oIndexes.Position;var nCount=oIndexes.Count;for(var nIndex=nCount-1;nIndex>=0;--nIndex){var oChange=this.m_aAllChanges[nPosition+nIndex];if(!oChange)continue;var oClass=oChange.GetClass();if(oChange.IsContentChange()){var _oChange=oChange.Copy();if(this.private_CommutateContentChanges(_oChange,nPosition+nCount))arrChanges.push(_oChange);oChange.SetReverted(true)}else{var _oChange=oChange;if(this.private_CommutatePropertyChanges(oClass,_oChange,nPosition+nCount))arrChanges.push(_oChange)}}this.m_aOwnChangesIndexes.length= +this.m_aOwnChangesIndexes.length-1;var arrReverseChanges=[];for(var nIndex=0,nCount=arrChanges.length;nIndex-1;--i)if(mapAddedSlides[oLogicDocument.Slides[i].Get_Id()]&&!oLogicDocument.Slides[i].Layout)oLogicDocument.removeSlide(i);for(var sId in mapSlides)if(mapSlides.hasOwnProperty(sId))mapSlides[sId].correctContent(); +if(bChangedLayout)for(var i=oLogicDocument.Slides.length-1;i>-1;--i){var Layout=oLogicDocument.Slides[i].Layout;if(!Layout||mapLayouts[Layout.Get_Id()])if(!oLogicDocument.Slides[i].CheckLayout())oLogicDocument.removeSlide(i)}for(var sId in mapGrObjects){var oShape=mapGrObjects[sId];if(!oShape.checkCorrect()){oShape.setBDeleted(true);if(oShape.group)oShape.group.removeFromSpTree(oShape.Get_Id());else if(AscFormat.Slide&&oShape.parent instanceof AscFormat.Slide)oShape.parent.removeFromSpTreeById(oShape.Get_Id()); +else if(AscCommonWord.ParaDrawing&&oShape.parent instanceof AscCommonWord.ParaDrawing)mapDrawings[oShape.parent.Get_Id()]=oShape.parent}else if(oShape.resetGroups)oShape.resetGroups()}var oDrawing;for(var sId in mapDrawings)if(mapDrawings.hasOwnProperty(sId)){oDrawing=mapDrawings[sId];if(!oDrawing.CheckCorrect()){var oParentParagraph=oDrawing.Get_ParentParagraph();oDrawing.PreDelete();oDrawing.Remove_FromDocument(false);if(oParentParagraph)mapParagraphs[oParentParagraph.Get_Id()]=oParentParagraph}}for(var sId in mapRuns)if(mapRuns.hasOwnProperty(sId)){var oRun= +mapRuns[sId];for(var nIndex=oRun.Content.length-1;nIndex>-1;--nIndex)if(oRun.Content[nIndex]instanceof AscCommonWord.ParaDrawing)if(!oRun.Content[nIndex].CheckCorrect()){oRun.Remove_FromContent(nIndex,1,false);if(oRun.Paragraph)mapParagraphs[oRun.Paragraph.Get_Id()]=oRun.Paragraph}}for(var sId in mapTables){var oTable=mapTables[sId];for(var nCurRow=oTable.Content.length-1;nCurRow>=0;--nCurRow){var oRow=oTable.Get_Row(nCurRow);if(oRow.Get_CellsCount()<=0)oTable.private_RemoveRow(nCurRow)}if(oTable.Parent instanceof +AscCommonWord.CDocument||oTable.Parent instanceof AscCommonWord.CDocumentContent)mapDocumentContents[oTable.Parent.Get_Id()]=oTable.Parent}for(var sId in mapDocumentContents){var oDocumentContent=mapDocumentContents[sId];var nContentLen=oDocumentContent.Content.length;for(var nIndex=nContentLen-1;nIndex>=0;--nIndex){var oElement=oDocumentContent.Content[nIndex];if((AscCommonWord.type_Paragraph===oElement.GetType()||AscCommonWord.type_Table===oElement.GetType())&&oElement.Content.length<=0)oDocumentContent.Remove_FromContent(nIndex, +1)}nContentLen=oDocumentContent.Content.length;if(nContentLen<=0||AscCommonWord.type_Paragraph!==oDocumentContent.Content[nContentLen-1].GetType()){var oNewParagraph=new AscCommonWord.Paragraph(oLogicDocument.Get_DrawingDocument(),oDocumentContent,0,0,0,0,0,false);oDocumentContent.Add_ToContent(nContentLen,oNewParagraph)}}for(var sId in mapParagraphs){var oParagraph=mapParagraphs[sId];oParagraph.CheckParaEnd();oParagraph.Correct_Content(null,null,true)}var oBinaryWriter=AscCommon.History.BinaryWriter; +var aSendingChanges=[];for(var nIndex=0,nCount=arrReverseChanges.length;nIndex=0;--nActionIndex){var oAction=arrActions[nActionIndex];var oResult=oAction;for(var nIndex=nStartPosition,nOverallCount= +this.m_aAllChanges.length;nIndex0)oChange.ConvertFromSimpleActions(arrCommutateActions);else return false;return true};CCollaborativeEditingBase.prototype.private_Commutate=function(oActionL,oActionR){if(oActionL.Add)if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++;else oActionR.Pos--;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else if(oActionL.Pos===oActionR.Pos)return false;else oActionR.Pos--;else if(oActionR.Add)if(oActionL.Pos>=oActionR.Pos)oActionL.Pos++; else oActionR.Pos++;else if(oActionL.Pos>oActionR.Pos)oActionL.Pos--;else oActionR.Pos++;return true};CCollaborativeEditingBase.prototype.private_CommutatePropertyChanges=function(oClass,oChange,nStartPosition){if(oChange.CheckCorrect&&!oChange.CheckCorrect())return false;return true};CCollaborativeEditingBase.prototype.private_RecalculateDocument=function(oRecalcData){};function CDocumentPositionsManager(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap= []}CDocumentPositionsManager.prototype.Clear_DocumentPositions=function(){this.m_aDocumentPositions=[];this.m_aDocumentPositionsSplit=[];this.m_aDocumentPositionsMap=[]};CDocumentPositionsManager.prototype.Add_DocumentPosition=function(Position){this.m_aDocumentPositions.push(Position)};CDocumentPositionsManager.prototype.Update_DocumentPositionsOnAdd=function(Class,Pos){for(var PosIndex=0,PosCount=this.m_aDocumentPositions.length;PosIndex