|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (C) Ascensio System SIA 2012-2021. All rights reserved
|
|
|
|
|
* Copyright (C) Ascensio System SIA 2012-2022. All rights reserved
|
|
|
|
|
*
|
|
|
|
|
* https://www.onlyoffice.com/
|
|
|
|
|
*
|
|
|
|
@ -11034,8 +11034,8 @@ oLogicDocument.StartAction(nPointType);callback.apply(this,args);oLogicDocument.
|
|
|
|
|
arrFields);return _arrFields},TurnOffCheckChartSelection:function(){this.bNoCheckChartTextSelection=true},TurnOnCheckChartSelection:function(){this.bNoCheckChartTextSelection=false},getDrawingDocument:function(){return editor.WordControl.m_oDrawingDocument},sortDrawingArrays:function(){for(var i=0;i<this.graphicPages.length;++i)if(this.graphicPages[i])this.graphicPages[i].sortDrawingArrays()},getSelectedObjects:function(){return this.selectedObjects},getSelectedArray:DrawingObjectsController.prototype.getSelectedArray,
|
|
|
|
|
getTheme:function(){return this.document.theme},getColorMapOverride:function(){return null},isViewMode:function(){return this.document.IsViewMode()},convertPixToMM:function(v){return this.document.DrawingDocument.GetMMPerDot(v)},getGraphicInfoUnderCursor:function(pageIndex,x,y){this.handleEventMode=HANDLE_EVENT_MODE_CURSOR;var ret=this.curState.onMouseDown(global_mouseEvent,x,y,pageIndex,false);this.handleEventMode=HANDLE_EVENT_MODE_HANDLE;if(ret&&ret.cursorType==="text")if(this.selection.chartSelection&&
|
|
|
|
|
this.selection.chartSelection.selection.textSelection||this.selection.groupSelection&&this.selection.groupSelection.selection.chartSelection&&this.selection.groupSelection.selection.chartSelection.selection.textSelection)ret={};return ret||{}},updateCursorType:function(pageIndex,x,y,e,bTextFlag){var ret;this.handleEventMode=HANDLE_EVENT_MODE_CURSOR;ret=this.curState.onMouseDown(global_mouseEvent,x,y,pageIndex,bTextFlag);this.handleEventMode=HANDLE_EVENT_MODE_HANDLE;if(ret){if(ret.cursorType!=="text"){var oApi=
|
|
|
|
|
Asc.editor||editor;var isDrawHandles=oApi?oApi.isShowShapeAdjustments():true;var oShape=null;var oInnerForm=null;if((oShape=AscCommon.g_oTableId.Get_ById(ret.objectId))&&oShape.isForm()&&(oInnerForm=oShape.getInnerForm())){if(isDrawHandles&&oInnerForm.IsFormLocked())isDrawHandles=false;var oPara;if(oInnerForm.IsPictureForm()&&oInnerForm.IsFixedForm()&&(oPara=oInnerForm.GetParagraph())){var X=x,Y=y;var oTransform=oPara.Get_ParentTextInvertTransform();if(oTransform){X=oTransform.TransformPointX(x,y);
|
|
|
|
|
Y=oTransform.TransformPointY(x,y)}oInnerForm.DrawContentControlsTrack(true,X,Y,0)}}if(isDrawHandles===false){this.drawingDocument.SetCursorType("default");return true}this.drawingDocument.SetCursorType(ret.cursorType)}return true}return false},removeTextSelection:function(){var oTargetDocContent=this.getTargetDocContent();if(oTargetDocContent&&oTargetDocContent.IsSelectionUse())oTargetDocContent.RemoveSelection()},getDefaultText:DrawingObjectsController.prototype.getDefaultText,canEdit:DrawingObjectsController.prototype.canEdit,
|
|
|
|
|
Asc.editor||editor;var isDrawHandles=oApi?oApi.isShowShapeAdjustments():true;var oShape=AscCommon.g_oTableId.Get_ById(ret.objectId);var oInnerForm=null;if(oShape&&oShape.isForm&&oShape.isForm()&&(oInnerForm=oShape.getInnerForm())){if(isDrawHandles&&oInnerForm.IsFormLocked())isDrawHandles=false;var oPara;if(oInnerForm.IsPictureForm()&&oInnerForm.IsFixedForm()&&(oPara=oInnerForm.GetParagraph())){var X=x,Y=y;var oTransform=oPara.Get_ParentTextInvertTransform();if(oTransform){X=oTransform.TransformPointX(x,
|
|
|
|
|
y);Y=oTransform.TransformPointY(x,y)}oInnerForm.DrawContentControlsTrack(true,X,Y,0)}}if(isDrawHandles===false){this.drawingDocument.SetCursorType("default");return true}this.drawingDocument.SetCursorType(ret.cursorType)}return true}return false},removeTextSelection:function(){var oTargetDocContent=this.getTargetDocContent();if(oTargetDocContent&&oTargetDocContent.IsSelectionUse())oTargetDocContent.RemoveSelection()},getDefaultText:DrawingObjectsController.prototype.getDefaultText,canEdit:DrawingObjectsController.prototype.canEdit,
|
|
|
|
|
createImage:DrawingObjectsController.prototype.createImage,createOleObject:DrawingObjectsController.prototype.createOleObject,createTextArt:DrawingObjectsController.prototype.createTextArt,getChartObject:DrawingObjectsController.prototype.getChartObject,getChartSpace2:DrawingObjectsController.prototype.getChartSpace2,CreateDocContent:DrawingObjectsController.prototype.CreateDocContent,isSlideShow:function(){return false},clearPreTrackObjects:function(){this.arrPreTrackObjects.length=0},addPreTrackObject:function(preTrackObject){this.arrPreTrackObjects.push(preTrackObject)},
|
|
|
|
|
clearTrackObjects:function(){this.arrTrackObjects.length=0},addTrackObject:function(trackObject){this.arrTrackObjects.push(trackObject)},swapTrackObjects:function(){this.clearTrackObjects();for(var i=0;i<this.arrPreTrackObjects.length;++i)this.addTrackObject(this.arrPreTrackObjects[i]);this.clearPreTrackObjects()},addToRecalculate:function(object){if(typeof object.Get_Id==="function"&&typeof object.recalculate==="function")History.RecalcData_Add({Type:AscDFH.historyitem_recalctype_Drawing,Object:object});
|
|
|
|
|
return},createWatermarkImage:DrawingObjectsController.prototype.createWatermarkImage,createWatermark:function(oProps){if(oProps.get_Type()===Asc.c_oAscWatermarkType.None)return null;var bTrackRevisions=false;if(this.document.IsTrackRevisions()){bTrackRevisions=this.document.GetLocalTrackRevisions();this.document.SetLocalTrackRevisions(false)}var oDrawing,extX,extY;var oSectPr=this.document.Get_SectionProps();var dMaxWidth=oSectPr.get_W()-oSectPr.get_LeftMargin()-oSectPr.get_RightMargin();var dMaxHeight=
|
|
|
|
@ -11230,9 +11230,9 @@ table;return}this.flowTables.push(table)},updateFloatTable:function(table){for(v
|
|
|
|
|
else drawing_array=this.beforeTextObjects;if(Array.isArray(drawing_array)){for(var i=0;i<drawing_array.length;++i)if(drawing_array[i]===object)break;if(i===drawing_array.length){drawing_array.push(object);if(need_sort)drawing_array.sort(ComparisonByZIndexSimpleParent)}}},concatPage:function(page){this.inlineObjects=this.inlineObjects.concat(page.inlineObjects);this.behindDocObjects=this.behindDocObjects.concat(page.behindDocObjects);this.beforeTextObjects=this.beforeTextObjects.concat(page.beforeTextObjects);
|
|
|
|
|
this.flowTables=this.flowTables.concat(page.flowTables)},mergePages:function(page1,page2){if(page1)this.concatPage(page1);if(page2)this.concatPage(page2);this.behindDocObjects.sort(ComparisonByZIndexSimpleParent);this.beforeTextObjects.sort(ComparisonByZIndexSimpleParent)},clear:function(){this.inlineObjects=[];this.behindDocObjects=[];this.beforeTextObjects=[];this.flowTables=[]},CheckRange:function(X0,Y0,X1,Y1,Y0sp,Y1Ssp,LeftField,RightField,HdrFtrRanges,docContent,bMathWrap){return this.wrapManager.checkRanges(X0,
|
|
|
|
|
Y0,X1,Y1,Y0sp,Y1Ssp,LeftField,RightField,HdrFtrRanges,docContent,bMathWrap)},removeFloatTableById:function(id){for(var index=0;index<this.flowTables.length;++index)if(this.flowTables[index].Id===id){this.flowTables.splice(index,1);return}},documentStatistics:function(Statistics){var cur_array=this.inlineObjects.concat(this.behindDocObjects).concat(this.beforeTextObjects);for(var i=0;i<cur_array.length;++i)if(cur_array[i].documentStatistics)cur_array[i].documentStatistics(Statistics)},getTableByXY:function(x,
|
|
|
|
|
y,documentContent){for(var index=this.flowTables.length-1;index>-1;--index)if(this.flowTables[index].IsPointIn(x,y)&&this.flowTables[index].CheckDocumentContent(documentContent))return this.flowTables[index];return null},delObjectById:function(id){var oDrawing=AscCommon.g_oTableId.Get_ById(id);if(oDrawing){var drawing_array;var Type=oDrawing.getDrawingArrayType();if(Type===DRAWING_ARRAY_TYPE_INLINE)drawing_array=this.inlineObjects;else if(Type===DRAWING_ARRAY_TYPE_BEHIND)drawing_array=this.behindDocObjects;
|
|
|
|
|
else drawing_array=this.beforeTextObjects;for(var index=0;index<drawing_array.length;++index)if(drawing_array[index].parent===oDrawing)return drawing_array.splice(index,1)}return null},resetDrawingArrays:function(docContent){function findInArrayAndRemove(drawingArray,docContent,document){if(docContent===document){drawingArray.length=0;return}var b_is_top_doc=docContent.Is_TopDocument();for(var i=drawingArray.length-1;i>-1;--i)if(!drawingArray[i].parent||drawingArray[i].parent.DocumentContent===docContent||
|
|
|
|
|
b_is_top_doc&&drawingArray[i].parent.DocumentContent.Is_TopDocument(true)===docContent)drawingArray.splice(i,1)}function findTableInArrayAndRemove(drawingArray,docContent,document){if(docContent===document){drawingArray.length=0;return}for(var i=drawingArray.length-1;i>-1;--i)if(drawingArray[i].Table.Parent.GetDocumentContentForRecalcInfo()===docContent)drawingArray.splice(i,1)}function findInArrayAndRemoveFromDrawingPage(drawingPage,docContent,document){if(!drawingPage)return;if(Array.isArray(drawingPage.inlineObjects)){findInArrayAndRemove(drawingPage.inlineObjects,
|
|
|
|
|
y,documentContent){for(var index=this.flowTables.length-1;index>-1;--index)if(this.flowTables[index].IsPointIn(x,y)&&this.flowTables[index].CheckDocumentContent(documentContent))return this.flowTables[index];return null},delObjectById:function(id){var oDrawing=AscCommon.g_oTableId.Get_ById(id);if(oDrawing&&oDrawing.getDrawingArrayType){var drawing_array;var Type=oDrawing.getDrawingArrayType();if(Type===DRAWING_ARRAY_TYPE_INLINE)drawing_array=this.inlineObjects;else if(Type===DRAWING_ARRAY_TYPE_BEHIND)drawing_array=
|
|
|
|
|
this.behindDocObjects;else drawing_array=this.beforeTextObjects;for(var index=0;index<drawing_array.length;++index)if(drawing_array[index].parent===oDrawing)return drawing_array.splice(index,1)}return null},resetDrawingArrays:function(docContent){function findInArrayAndRemove(drawingArray,docContent,document){if(docContent===document){drawingArray.length=0;return}var b_is_top_doc=docContent.Is_TopDocument();for(var i=drawingArray.length-1;i>-1;--i)if(!drawingArray[i].parent||drawingArray[i].parent.DocumentContent===
|
|
|
|
|
docContent||b_is_top_doc&&drawingArray[i].parent.DocumentContent.Is_TopDocument(true)===docContent)drawingArray.splice(i,1)}function findTableInArrayAndRemove(drawingArray,docContent,document){if(docContent===document){drawingArray.length=0;return}for(var i=drawingArray.length-1;i>-1;--i)if(drawingArray[i].Table.Parent.GetDocumentContentForRecalcInfo()===docContent)drawingArray.splice(i,1)}function findInArrayAndRemoveFromDrawingPage(drawingPage,docContent,document){if(!drawingPage)return;if(Array.isArray(drawingPage.inlineObjects)){findInArrayAndRemove(drawingPage.inlineObjects,
|
|
|
|
|
docContent,document);findInArrayAndRemove(drawingPage.behindDocObjects,docContent,document);findInArrayAndRemove(drawingPage.beforeTextObjects,docContent,document);findTableInArrayAndRemove(drawingPage.flowTables,docContent,document)}}if(!AscCommon.isRealObject(docContent))docContent=this.graphicObjects.document;findInArrayAndRemoveFromDrawingPage(this,docContent,editor.WordControl.m_oLogicDocument)},draw:function(graphics){for(var _object_index=0;_object_index<this.inlineObjects.length;++_object_index)this.inlineObjects[_object_index].draw(graphics);
|
|
|
|
|
for(_object_index=0;_object_index<this.beforeTextObjects.length;++_object_index)this.beforeTextObjects[_object_index].draw(graphics);for(_object_index=0;_object_index<this.behindDocObjects.length;++_object_index)this.behindDocObjects[_object_index].draw(graphics)},drawSelect:function(){var oApi=Asc.editor||editor;var isDrawHandles=oApi?oApi.isShowShapeAdjustments():true;var _graphic_objects=this.selectionInfo.selectionArray;var _object_index;var _objects_count=_graphic_objects.length;var _graphic_object;
|
|
|
|
|
for(_object_index=0;_object_index<_objects_count;++_object_index){_graphic_object=_graphic_objects[_object_index].graphicObject;var _transform=_graphic_object.getTransformMatrix();if(_transform===null)_transform=new AscCommon.CMatrix;var _extensions=_graphic_object.getExtensions();if(_extensions===null)_extensions={extX:0,extY:0};this.drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.SHAPE,_transform,0,0,_extensions.extX,_extensions.extY,false,undefined,undefined,isDrawHandles)}},selectionCheck:function(x,
|
|
|
|
@ -13664,8 +13664,8 @@ if(!oRun.m_oContentChanges)return;for(var Index=0,Count=this.Items.length;Index<
|
|
|
|
|
AscCommon.CollaborativeEditing.Update_DocumentPositionsOnAdd(oRun,Pos);if(Element.SetParent)Element.SetParent(oRun)}}oRun.RecalcInfo.Measure=true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false);oRun.private_UpdateDocumentOutline()};CChangesRunAddItem.prototype.IsRelated=function(oChanges){if(this.Class===oChanges.Class&&(AscDFH.historyitem_ParaRun_AddItem===oChanges.Type||AscDFH.historyitem_ParaRun_RemoveItem===oChanges.Type))return true;return false};CChangesRunAddItem.prototype.CreateReverseChange=
|
|
|
|
|
function(){return this.private_CreateReverseChange(CChangesRunRemoveItem)};function CChangesRunRemoveItem(Class,Pos,Items){AscDFH.CChangesBaseContentChange.call(this,Class,Pos,Items,false)}CChangesRunRemoveItem.prototype=Object.create(AscDFH.CChangesBaseContentChange.prototype);CChangesRunRemoveItem.prototype.constructor=CChangesRunRemoveItem;CChangesRunRemoveItem.prototype.Type=AscDFH.historyitem_ParaRun_RemoveItem;CChangesRunRemoveItem.prototype.Undo=function(){var oRun=this.Class;var Array_start=
|
|
|
|
|
oRun.Content.slice(0,this.Pos);var Array_end=oRun.Content.slice(this.Pos);oRun.Content=Array_start.concat(this.Items,Array_end);oRun.RecalcInfo.Measure=true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false);for(var nIndex=0,nCount=this.Items.length;nIndex<nCount;++nIndex)if(this.Items[nIndex].SetParent)this.Items[nIndex].SetParent(oRun)};CChangesRunRemoveItem.prototype.Redo=function(){var oRun=this.Class;oRun.Content.splice(this.Pos,this.Items.length);oRun.RecalcInfo.Measure=
|
|
|
|
|
true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false)};CChangesRunRemoveItem.prototype.private_WriteItem=function(Writer,Item){Item.Write_ToBinary(Writer)};CChangesRunRemoveItem.prototype.private_ReadItem=function(Reader){return ParagraphContent_Read_FromBinary(Reader)};CChangesRunRemoveItem.prototype.Load=function(){var oRun=this.Class;var nLastChangesPos=null;var nChangesCount=0;for(var Index=0,Count=this.PosArray.length;Index<Count;Index++){var nChangesPos=
|
|
|
|
|
oRun.m_oContentChanges.Check(AscCommon.contentchanges_Remove,this.PosArray[Index]);if(false===nChangesPos)continue;if(null===nLastChangesPos){nLastChangesPos=nChangesPos;nChangesCount=1}else if(nLastChangesPos===nChangesPos)nChangesCount++;else{oRun.CollaborativeMarks.Update_OnRemove(nLastChangesPos,nChangesCount);oRun.Content.splice(nLastChangesPos,nChangesCount);oRun.private_UpdatePositionsOnRemove(nLastChangesPos,nChangesCount);oRun.private_UpdateCompositeInputPositionsOnRemove(nLastChangesPos,
|
|
|
|
|
true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false)};CChangesRunRemoveItem.prototype.private_WriteItem=function(Writer,Item){Item.Write_ToBinary(Writer)};CChangesRunRemoveItem.prototype.private_ReadItem=function(Reader){return ParagraphContent_Read_FromBinary(Reader)};CChangesRunRemoveItem.prototype.Load=function(){var oRun=this.Class;if(!oRun.m_oContentChanges)return;var nLastChangesPos=null;var nChangesCount=0;for(var Index=0,Count=this.PosArray.length;Index<
|
|
|
|
|
Count;Index++){var nChangesPos=oRun.m_oContentChanges.Check(AscCommon.contentchanges_Remove,this.PosArray[Index]);if(false===nChangesPos)continue;if(null===nLastChangesPos){nLastChangesPos=nChangesPos;nChangesCount=1}else if(nLastChangesPos===nChangesPos)nChangesCount++;else{oRun.CollaborativeMarks.Update_OnRemove(nLastChangesPos,nChangesCount);oRun.Content.splice(nLastChangesPos,nChangesCount);oRun.private_UpdatePositionsOnRemove(nLastChangesPos,nChangesCount);oRun.private_UpdateCompositeInputPositionsOnRemove(nLastChangesPos,
|
|
|
|
|
nChangesCount);AscCommon.CollaborativeEditing.Update_DocumentPositionsOnRemove(oRun,nLastChangesPos,nChangesCount);nLastChangesPos=nChangesPos;nChangesCount=1}}if(nChangesCount){oRun.CollaborativeMarks.Update_OnRemove(nLastChangesPos,nChangesCount);oRun.Content.splice(nLastChangesPos,nChangesCount);oRun.private_UpdatePositionsOnRemove(nLastChangesPos,nChangesCount);oRun.private_UpdateCompositeInputPositionsOnRemove(nLastChangesPos,nChangesCount);AscCommon.CollaborativeEditing.Update_DocumentPositionsOnRemove(oRun,
|
|
|
|
|
nLastChangesPos,nChangesCount)}oRun.RecalcInfo.Measure=true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false);oRun.private_UpdateDocumentOutline()};CChangesRunRemoveItem.prototype.IsRelated=function(oChanges){if(this.Class===oChanges.Class&&(AscDFH.historyitem_ParaRun_AddItem===oChanges.Type||AscDFH.historyitem_ParaRun_RemoveItem===oChanges.Type))return true;return false};CChangesRunRemoveItem.prototype.CreateReverseChange=function(){return this.private_CreateReverseChange(CChangesRunAddItem)};
|
|
|
|
|
function CChangesRunBold(Class,Old,New,Color){AscDFH.CChangesBaseBoolProperty.call(this,Class,Old,New,Color)}CChangesRunBold.prototype=Object.create(AscDFH.CChangesBaseBoolProperty.prototype);CChangesRunBold.prototype.constructor=CChangesRunBold;CChangesRunBold.prototype.Type=AscDFH.historyitem_ParaRun_Bold;CChangesRunBold.prototype.private_SetValue=function(Value){var oRun=this.Class;oRun.Pr.Bold=Value;oRun.Recalc_CompiledPr(true);oRun.private_UpdateTrackRevisionOnChangeTextPr(false)};CChangesRunBold.prototype.Load=
|
|
|
|
|