diff --git a/www/common/onlyoffice/v4/sdkjs/cell/sdk-all.js b/www/common/onlyoffice/v4/sdkjs/cell/sdk-all.js index 967b507e9..5207ee464 100644 --- a/www/common/onlyoffice/v4/sdkjs/cell/sdk-all.js +++ b/www/common/onlyoffice/v4/sdkjs/cell/sdk-all.js @@ -20067,59 +20067,59 @@ this.CheckFootnote(X,Y,CurPage);if(isInText&&null!=oHyperlink&&(Y<=this.Pages[Cu Asc.c_oAscMouseMoveDataTypes.Common;if(isInText&&(null!=oHyperlink||bPageRefLink)&&true===AscCommon.global_keyboardEvent.CtrlKey)this.DrawingDocument.SetCursorType("pointer",MMData);else this.DrawingDocument.SetCursorType("text",MMData);var Bounds=this.Pages[CurPage].Bounds;if(true===this.Lock.Is_Locked()&&XBounds.Left&&Y>Bounds.Top&&YEndPos){StartPos=this.Selection.EndPos;EndPos=this.Selection.StartPos}for(var CurPos= -StartPos;CurPos<=EndPos;CurPos++){var Element=this.Content[CurPos];if(true!==Element.IsSelectionEmpty()&&Element.Document_UpdateInterfaceState)Element.Document_UpdateInterfaceState()}}else{var CurType=this.Content[this.CurPos.ContentPos].Type;if(this.Content[this.CurPos.ContentPos].Document_UpdateInterfaceState)this.Content[this.CurPos.ContentPos].Document_UpdateInterfaceState()}var arrComplexFields=this.GetCurrentComplexFields();for(var nIndex=0,nCount=arrComplexFields.length;nIndex0)for(var ChangeIndex=0,ChangesCount=Changes.length;ChangeIndex= -0&&StartPos.Compare(Change.get_EndPos())<=0){Change.put_InternalPos(_X,_Y,Page_abs);TrackManager.AddVisibleChange(Change)}}}}};Paragraph.prototype.PreDelete=function(){for(var Index=0;Index=Count)return{X:X0, -Y:Y0,W:X1-X0,H:Y1-Y0};for(var Index=0;IndexX1)X1=_X1}var _Y1=Y1;var BottomBorder=Paras[Count-1].Get_CompiledPr2(false).ParaPr.Brd.Bottom; -if(undefined!==BottomBorder&&border_None!==BottomBorder.Value)_Y1+=BottomBorder.Size+BottomBorder.Space;if(_Y1>Y1&&(Asc.linerule_Auto===FramePr.HRule||Asc.linerule_AtLeast===FramePr.HRule&&FrameH>=FramePr.H))Y1=_Y1;return{X:X0,Y:Y0,W:X1-X0,H:Y1-Y0}};Paragraph.prototype.SetCalculatedFrame=function(oFrame){this.CalculatedFrame=oFrame;oFrame.AddParagraph(this)};Paragraph.prototype.GetCalculatedFrame=function(){return this.CalculatedFrame};Paragraph.prototype.Internal_Get_FrameParagraphs=function(){if(this.CalculatedFrame&& -this.CalculatedFrame.GetParagraphs().length>0)return this.CalculatedFrame.GetParagraphs();var FrameParas=[];var FramePr=this.Get_FramePr();if(undefined===FramePr)return FrameParas;FrameParas.push(this);var Prev=this.Get_DocumentPrev();while(null!=Prev)if(type_Paragraph===Prev.GetType()){var PrevFramePr=Prev.Get_FramePr();if(undefined!=PrevFramePr&&true===FramePr.Compare(PrevFramePr)){FrameParas.push(Prev);Prev=Prev.Get_DocumentPrev()}else break}else break;var Next=this.Get_DocumentNext();while(null!= -Next)if(type_Paragraph===Next.GetType()){var NextFramePr=Next.Get_FramePr();if(undefined!=NextFramePr&&true===FramePr.Compare(NextFramePr)){FrameParas.push(Next);Next=Next.Get_DocumentNext()}else break}else break;return FrameParas};Paragraph.prototype.Is_LineDropCap=function(){var FrameParas=this.Internal_Get_FrameParagraphs();if(1!==FrameParas.length||1!==this.Lines.length)return false;return true};Paragraph.prototype.Get_LineDropCapWidth=function(){var W=this.Lines[0].Ranges[0].W;var ParaPr=this.Get_CompiledPr2(false).ParaPr; -W+=ParaPr.Ind.Left+ParaPr.Ind.FirstLine;return W};Paragraph.prototype.Change_Frame=function(X,Y,W,H,PageIndex){if(!this.LogicDocument||!this.CalculatedFrame||!this.CalculatedFrame.GetFramePr())return;var FramePr=this.CalculatedFrame.GetFramePr();if(Math.abs(Y-this.CalculatedFrame.T2)<.001&&Math.abs(X-this.CalculatedFrame.L2)<.001&&Math.abs(W-this.CalculatedFrame.W2)<.001&&Math.abs(H-this.CalculatedFrame.H2)<.001&&PageIndex===this.CalculatedFrame.PageIndex)return;var FrameParas=this.Internal_Get_FrameParagraphs(); -if(false===this.LogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_None,{Type:AscCommon.changestype_2_ElementsArray_and_Type,Elements:FrameParas,CheckType:AscCommon.changestype_Paragraph_Content})){this.LogicDocument.StartAction(AscDFH.historydescription_Document_ParagraphChangeFrame);var NewFramePr=FramePr.Copy();if(Math.abs(X-this.CalculatedFrame.L2)>.001){NewFramePr.X=X+(this.CalculatedFrame.L-this.CalculatedFrame.L2);NewFramePr.XAlign=undefined;NewFramePr.HAnchor=Asc.c_oAscHAnchor.Page}if(Math.abs(Y- -this.CalculatedFrame.T2)>.001){NewFramePr.Y=Y+(this.CalculatedFrame.T-this.CalculatedFrame.T2);NewFramePr.YAlign=undefined;NewFramePr.VAnchor=Asc.c_oAscVAnchor.Page}if(Math.abs(W-this.CalculatedFrame.W2)>.001)NewFramePr.W=W-Math.abs(this.CalculatedFrame.W2-this.CalculatedFrame.W);if(Math.abs(H-this.CalculatedFrame.H2)>.001)if(undefined!=FramePr.DropCap&&Asc.c_oAscDropCap.None!=FramePr.DropCap&&1===FrameParas.length){var PageH=this.LogicDocument.Get_PageLimits(PageIndex).YLimit;var _H=Math.min(H,PageH); -NewFramePr.Lines=this.Update_DropCapByHeight(_H);NewFramePr.HRule=linerule_Exact;NewFramePr.H=H-Math.abs(this.CalculatedFrame.H2-this.CalculatedFrame.H)}else{if(H<=this.CalculatedFrame.H2)NewFramePr.HRule=linerule_Exact;else NewFramePr.HRule=Asc.linerule_AtLeast;NewFramePr.H=H}var Count=FrameParas.length;for(var Index=0;Index0))return}};Paragraph.prototype.Split_DropCap=function(NewParagraph){var DropCapText=new CParagraphGetDropCapText;if(true==this.Selection.Use&&this.Parent.IsSelectedSingleElement()){var SelSP=this.Get_ParaContentPos(true,true);var SelEP=this.Get_ParaContentPos(true,false);if(0<=SelSP.Compare(SelEP))SelEP=SelSP;DropCapText.Check=true;this.Get_TextForDropCap(DropCapText,true,SelEP, -0);DropCapText.Check=false;this.Get_TextForDropCap(DropCapText,true,SelEP,0)}else{DropCapText.Mixed=true;DropCapText.Check=false;this.Get_TextForDropCap(DropCapText,false)}var Count=DropCapText.Text.length;var PrevRun=null;var CurrRun=null;for(var Pos=0,ParaPos=0,RunPos=0;Pos0)return DropCapText.Runs[Count-1].Get_CompiledPr(true);return null};Paragraph.prototype.SelectFirstLetter=function(){var oStartPos=new CParagraphContentPos;var oEndPos=new CParagraphContentPos;for(var nPos=0,nCount=this.Content.length;nPos0;CurPage--)if(Data.Pos>this.Lines[this.Pages[CurPage].StartLine].Get_StartPos())break;this.RecalcInfo.Set_Type_0(pararecalc_0_All);bNeedRecalc=true;break}case AscDFH.historyitem_Paragraph_Numbering:case AscDFH.historyitem_Paragraph_PStyle:case AscDFH.historyitem_Paragraph_Pr:case AscDFH.historyitem_Paragraph_PresentationPr_Bullet:case AscDFH.historyitem_Paragraph_PresentationPr_Level:{this.RecalcInfo.Set_Type_0(pararecalc_0_All); -bNeedRecalc=true;this.CompiledPr.NeedRecalc=true;this.Recalc_RunsCompiledPr();break}case AscDFH.historyitem_Paragraph_Align:case AscDFH.historyitem_Paragraph_DefaultTabSize:case AscDFH.historyitem_Paragraph_Ind_First:case AscDFH.historyitem_Paragraph_Ind_Left:case AscDFH.historyitem_Paragraph_Ind_Right:case AscDFH.historyitem_Paragraph_ContextualSpacing:case AscDFH.historyitem_Paragraph_KeepLines:case AscDFH.historyitem_Paragraph_KeepNext:case AscDFH.historyitem_Paragraph_PageBreakBefore:case AscDFH.historyitem_Paragraph_Spacing_Line:case AscDFH.historyitem_Paragraph_Spacing_LineRule:case AscDFH.historyitem_Paragraph_Spacing_Before:case AscDFH.historyitem_Paragraph_Spacing_After:case AscDFH.historyitem_Paragraph_Spacing_AfterAutoSpacing:case AscDFH.historyitem_Paragraph_Spacing_BeforeAutoSpacing:case AscDFH.historyitem_Paragraph_WidowControl:case AscDFH.historyitem_Paragraph_Tabs:case AscDFH.historyitem_Paragraph_Borders_Between:case AscDFH.historyitem_Paragraph_Borders_Bottom:case AscDFH.historyitem_Paragraph_Borders_Left:case AscDFH.historyitem_Paragraph_Borders_Right:case AscDFH.historyitem_Paragraph_Borders_Top:case AscDFH.historyitem_Paragraph_FramePr:{bNeedRecalc= +Paragraph.prototype.Document_CreateFontCharMap=function(FontCharMap){};Paragraph.prototype.Document_Get_AllFontNames=function(AllFonts){this.TextPr.Value.Document_Get_AllFontNames(AllFonts);if(this.Pr.Bullet)this.Pr.Bullet.Get_AllFontNames(AllFonts);if(this.Pr.DefaultRunPr)this.Pr.DefaultRunPr.Document_Get_AllFontNames(AllFonts);var Count=this.Content.length;for(var Index=0;IndexEndPos){StartPos=this.Selection.EndPos;EndPos=this.Selection.StartPos}for(var CurPos=StartPos;CurPos<=EndPos;CurPos++){var Element=this.Content[CurPos];if(true!==Element.IsSelectionEmpty()&&Element.Document_UpdateInterfaceState)Element.Document_UpdateInterfaceState()}}else{var CurType=this.Content[this.CurPos.ContentPos].Type;if(this.Content[this.CurPos.ContentPos].Document_UpdateInterfaceState)this.Content[this.CurPos.ContentPos].Document_UpdateInterfaceState()}var arrComplexFields=this.GetCurrentComplexFields(); +for(var nIndex=0,nCount=arrComplexFields.length;nIndex0)for(var ChangeIndex=0,ChangesCount=Changes.length;ChangeIndex=0&&StartPos.Compare(Change.get_EndPos())<=0){Change.put_InternalPos(_X,_Y,Page_abs);TrackManager.AddVisibleChange(Change)}}}}};Paragraph.prototype.PreDelete=function(){for(var Index=0;Index=Count)return{X:X0,Y:Y0,W:X1-X0,H:Y1-Y0};for(var Index=0;IndexX1)X1=_X1}var _Y1=Y1;var BottomBorder=Paras[Count-1].Get_CompiledPr2(false).ParaPr.Brd.Bottom;if(undefined!==BottomBorder&&border_None!==BottomBorder.Value)_Y1+=BottomBorder.Size+BottomBorder.Space;if(_Y1>Y1&&(Asc.linerule_Auto===FramePr.HRule||Asc.linerule_AtLeast===FramePr.HRule&&FrameH>=FramePr.H))Y1=_Y1;return{X:X0,Y:Y0,W:X1-X0,H:Y1-Y0}};Paragraph.prototype.SetCalculatedFrame=function(oFrame){this.CalculatedFrame= +oFrame;oFrame.AddParagraph(this)};Paragraph.prototype.GetCalculatedFrame=function(){return this.CalculatedFrame};Paragraph.prototype.Internal_Get_FrameParagraphs=function(){if(this.CalculatedFrame&&this.CalculatedFrame.GetParagraphs().length>0)return this.CalculatedFrame.GetParagraphs();var FrameParas=[];var FramePr=this.Get_FramePr();if(undefined===FramePr)return FrameParas;FrameParas.push(this);var Prev=this.Get_DocumentPrev();while(null!=Prev)if(type_Paragraph===Prev.GetType()){var PrevFramePr= +Prev.Get_FramePr();if(undefined!=PrevFramePr&&true===FramePr.Compare(PrevFramePr)){FrameParas.push(Prev);Prev=Prev.Get_DocumentPrev()}else break}else break;var Next=this.Get_DocumentNext();while(null!=Next)if(type_Paragraph===Next.GetType()){var NextFramePr=Next.Get_FramePr();if(undefined!=NextFramePr&&true===FramePr.Compare(NextFramePr)){FrameParas.push(Next);Next=Next.Get_DocumentNext()}else break}else break;return FrameParas};Paragraph.prototype.Is_LineDropCap=function(){var FrameParas=this.Internal_Get_FrameParagraphs(); +if(1!==FrameParas.length||1!==this.Lines.length)return false;return true};Paragraph.prototype.Get_LineDropCapWidth=function(){var W=this.Lines[0].Ranges[0].W;var ParaPr=this.Get_CompiledPr2(false).ParaPr;W+=ParaPr.Ind.Left+ParaPr.Ind.FirstLine;return W};Paragraph.prototype.Change_Frame=function(X,Y,W,H,PageIndex){if(!this.LogicDocument||!this.CalculatedFrame||!this.CalculatedFrame.GetFramePr())return;var FramePr=this.CalculatedFrame.GetFramePr();if(Math.abs(Y-this.CalculatedFrame.T2)<.001&&Math.abs(X- +this.CalculatedFrame.L2)<.001&&Math.abs(W-this.CalculatedFrame.W2)<.001&&Math.abs(H-this.CalculatedFrame.H2)<.001&&PageIndex===this.CalculatedFrame.PageIndex)return;var FrameParas=this.Internal_Get_FrameParagraphs();if(false===this.LogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_None,{Type:AscCommon.changestype_2_ElementsArray_and_Type,Elements:FrameParas,CheckType:AscCommon.changestype_Paragraph_Content})){this.LogicDocument.StartAction(AscDFH.historydescription_Document_ParagraphChangeFrame); +var NewFramePr=FramePr.Copy();if(Math.abs(X-this.CalculatedFrame.L2)>.001){NewFramePr.X=X+(this.CalculatedFrame.L-this.CalculatedFrame.L2);NewFramePr.XAlign=undefined;NewFramePr.HAnchor=Asc.c_oAscHAnchor.Page}if(Math.abs(Y-this.CalculatedFrame.T2)>.001){NewFramePr.Y=Y+(this.CalculatedFrame.T-this.CalculatedFrame.T2);NewFramePr.YAlign=undefined;NewFramePr.VAnchor=Asc.c_oAscVAnchor.Page}if(Math.abs(W-this.CalculatedFrame.W2)>.001)NewFramePr.W=W-Math.abs(this.CalculatedFrame.W2-this.CalculatedFrame.W); +if(Math.abs(H-this.CalculatedFrame.H2)>.001)if(undefined!=FramePr.DropCap&&Asc.c_oAscDropCap.None!=FramePr.DropCap&&1===FrameParas.length){var PageH=this.LogicDocument.Get_PageLimits(PageIndex).YLimit;var _H=Math.min(H,PageH);NewFramePr.Lines=this.Update_DropCapByHeight(_H);NewFramePr.HRule=linerule_Exact;NewFramePr.H=H-Math.abs(this.CalculatedFrame.H2-this.CalculatedFrame.H)}else{if(H<=this.CalculatedFrame.H2)NewFramePr.HRule=linerule_Exact;else NewFramePr.HRule=Asc.linerule_AtLeast;NewFramePr.H= +H}var Count=FrameParas.length;for(var Index=0;Index0))return}};Paragraph.prototype.Split_DropCap=function(NewParagraph){var DropCapText=new CParagraphGetDropCapText;if(true==this.Selection.Use&&this.Parent.IsSelectedSingleElement()){var SelSP= +this.Get_ParaContentPos(true,true);var SelEP=this.Get_ParaContentPos(true,false);if(0<=SelSP.Compare(SelEP))SelEP=SelSP;DropCapText.Check=true;this.Get_TextForDropCap(DropCapText,true,SelEP,0);DropCapText.Check=false;this.Get_TextForDropCap(DropCapText,true,SelEP,0)}else{DropCapText.Mixed=true;DropCapText.Check=false;this.Get_TextForDropCap(DropCapText,false)}var Count=DropCapText.Text.length;var PrevRun=null;var CurrRun=null;for(var Pos=0,ParaPos=0,RunPos=0;Pos0)return DropCapText.Runs[Count-1].Get_CompiledPr(true);return null};Paragraph.prototype.SelectFirstLetter=function(){var oStartPos=new CParagraphContentPos;var oEndPos=new CParagraphContentPos;for(var nPos=0,nCount=this.Content.length;nPos0;CurPage--)if(Data.Pos>this.Lines[this.Pages[CurPage].StartLine].Get_StartPos())break; +this.RecalcInfo.Set_Type_0(pararecalc_0_All);bNeedRecalc=true;break}case AscDFH.historyitem_Paragraph_Numbering:case AscDFH.historyitem_Paragraph_PStyle:case AscDFH.historyitem_Paragraph_Pr:case AscDFH.historyitem_Paragraph_PresentationPr_Bullet:case AscDFH.historyitem_Paragraph_PresentationPr_Level:{this.RecalcInfo.Set_Type_0(pararecalc_0_All);bNeedRecalc=true;this.CompiledPr.NeedRecalc=true;this.Recalc_RunsCompiledPr();break}case AscDFH.historyitem_Paragraph_Align:case AscDFH.historyitem_Paragraph_DefaultTabSize:case AscDFH.historyitem_Paragraph_Ind_First:case AscDFH.historyitem_Paragraph_Ind_Left:case AscDFH.historyitem_Paragraph_Ind_Right:case AscDFH.historyitem_Paragraph_ContextualSpacing:case AscDFH.historyitem_Paragraph_KeepLines:case AscDFH.historyitem_Paragraph_KeepNext:case AscDFH.historyitem_Paragraph_PageBreakBefore:case AscDFH.historyitem_Paragraph_Spacing_Line:case AscDFH.historyitem_Paragraph_Spacing_LineRule:case AscDFH.historyitem_Paragraph_Spacing_Before:case AscDFH.historyitem_Paragraph_Spacing_After:case AscDFH.historyitem_Paragraph_Spacing_AfterAutoSpacing:case AscDFH.historyitem_Paragraph_Spacing_BeforeAutoSpacing:case AscDFH.historyitem_Paragraph_WidowControl:case AscDFH.historyitem_Paragraph_Tabs:case AscDFH.historyitem_Paragraph_Borders_Between:case AscDFH.historyitem_Paragraph_Borders_Bottom:case AscDFH.historyitem_Paragraph_Borders_Left:case AscDFH.historyitem_Paragraph_Borders_Right:case AscDFH.historyitem_Paragraph_Borders_Top:case AscDFH.historyitem_Paragraph_FramePr:{bNeedRecalc= true;break}case AscDFH.historyitem_Paragraph_Shd_Value:case AscDFH.historyitem_Paragraph_Shd_Color:case AscDFH.historyitem_Paragraph_Shd_Unifill:case AscDFH.historyitem_Paragraph_Shd:{if(this.Parent){var oDrawingShape=this.Parent.Is_DrawingShape(true);if(oDrawingShape&&oDrawingShape.getObjectType&&oDrawingShape.getObjectType()===AscDFH.historyitem_type_Shape)if(oDrawingShape.chekBodyPrTransform(oDrawingShape.getBodyPr())||oDrawingShape.checkContentWordArt(oDrawingShape.getDocContent()))bNeedRecalc= true;if(this.Parent.IsTableHeader())bNeedRecalc=true}break}case AscDFH.historyitem_Paragraph_SectionPr:{if(this.Parent instanceof CDocument){this.Parent.UpdateContentIndexing();var nSectionIndex=this.Parent.GetSectionIndexByElementIndex(this.GetIndex());var oFirstElement=this.Parent.GetFirstElementInSection(nSectionIndex);if(oFirstElement)this.Parent.Refresh_RecalcData2(oFirstElement.GetIndex(),oFirstElement.private_GetRelativePageIndex(0))}break}case AscDFH.historyitem_Paragraph_PrChange:{if(Data instanceof CChangesParagraphPrChange&&Data.IsChangedNumbering())bNeedRecalc=true;break}case AscDFH.historyitem_Paragraph_SuppressLineNumbers:{History.AddLineNumbersToRecalculateData();break}}if(true===bNeedRecalc){var Prev=this.Get_DocumentPrev();if(0===CurPage&&null!=Prev&&type_Paragraph===Prev.GetType()&&true===Prev.Get_CompiledPr2(false).ParaPr.KeepNext)Prev.Refresh_RecalcData2(Prev.Pages.length-1);return this.Refresh_RecalcData2(CurPage)}};Paragraph.prototype.Refresh_RecalcData2=function(CurPage){if(!CurPage)CurPage= diff --git a/www/common/onlyoffice/v4/sdkjs/slide/sdk-all.js b/www/common/onlyoffice/v4/sdkjs/slide/sdk-all.js index e46e6fbb1..ddd6ca2fe 100644 --- a/www/common/onlyoffice/v4/sdkjs/slide/sdk-all.js +++ b/www/common/onlyoffice/v4/sdkjs/slide/sdk-all.js @@ -19395,59 +19395,59 @@ this.CheckFootnote(X,Y,CurPage);if(isInText&&null!=oHyperlink&&(Y<=this.Pages[Cu Asc.c_oAscMouseMoveDataTypes.Common;if(isInText&&(null!=oHyperlink||bPageRefLink)&&true===AscCommon.global_keyboardEvent.CtrlKey)this.DrawingDocument.SetCursorType("pointer",MMData);else this.DrawingDocument.SetCursorType("text",MMData);var Bounds=this.Pages[CurPage].Bounds;if(true===this.Lock.Is_Locked()&&XBounds.Left&&Y>Bounds.Top&&YEndPos){StartPos=this.Selection.EndPos;EndPos=this.Selection.StartPos}for(var CurPos= -StartPos;CurPos<=EndPos;CurPos++){var Element=this.Content[CurPos];if(true!==Element.IsSelectionEmpty()&&Element.Document_UpdateInterfaceState)Element.Document_UpdateInterfaceState()}}else{var CurType=this.Content[this.CurPos.ContentPos].Type;if(this.Content[this.CurPos.ContentPos].Document_UpdateInterfaceState)this.Content[this.CurPos.ContentPos].Document_UpdateInterfaceState()}var arrComplexFields=this.GetCurrentComplexFields();for(var nIndex=0,nCount=arrComplexFields.length;nIndex0)for(var ChangeIndex=0,ChangesCount=Changes.length;ChangeIndex= -0&&StartPos.Compare(Change.get_EndPos())<=0){Change.put_InternalPos(_X,_Y,Page_abs);TrackManager.AddVisibleChange(Change)}}}}};Paragraph.prototype.PreDelete=function(){for(var Index=0;Index=Count)return{X:X0, -Y:Y0,W:X1-X0,H:Y1-Y0};for(var Index=0;IndexX1)X1=_X1}var _Y1=Y1;var BottomBorder=Paras[Count-1].Get_CompiledPr2(false).ParaPr.Brd.Bottom; -if(undefined!==BottomBorder&&border_None!==BottomBorder.Value)_Y1+=BottomBorder.Size+BottomBorder.Space;if(_Y1>Y1&&(Asc.linerule_Auto===FramePr.HRule||Asc.linerule_AtLeast===FramePr.HRule&&FrameH>=FramePr.H))Y1=_Y1;return{X:X0,Y:Y0,W:X1-X0,H:Y1-Y0}};Paragraph.prototype.SetCalculatedFrame=function(oFrame){this.CalculatedFrame=oFrame;oFrame.AddParagraph(this)};Paragraph.prototype.GetCalculatedFrame=function(){return this.CalculatedFrame};Paragraph.prototype.Internal_Get_FrameParagraphs=function(){if(this.CalculatedFrame&& -this.CalculatedFrame.GetParagraphs().length>0)return this.CalculatedFrame.GetParagraphs();var FrameParas=[];var FramePr=this.Get_FramePr();if(undefined===FramePr)return FrameParas;FrameParas.push(this);var Prev=this.Get_DocumentPrev();while(null!=Prev)if(type_Paragraph===Prev.GetType()){var PrevFramePr=Prev.Get_FramePr();if(undefined!=PrevFramePr&&true===FramePr.Compare(PrevFramePr)){FrameParas.push(Prev);Prev=Prev.Get_DocumentPrev()}else break}else break;var Next=this.Get_DocumentNext();while(null!= -Next)if(type_Paragraph===Next.GetType()){var NextFramePr=Next.Get_FramePr();if(undefined!=NextFramePr&&true===FramePr.Compare(NextFramePr)){FrameParas.push(Next);Next=Next.Get_DocumentNext()}else break}else break;return FrameParas};Paragraph.prototype.Is_LineDropCap=function(){var FrameParas=this.Internal_Get_FrameParagraphs();if(1!==FrameParas.length||1!==this.Lines.length)return false;return true};Paragraph.prototype.Get_LineDropCapWidth=function(){var W=this.Lines[0].Ranges[0].W;var ParaPr=this.Get_CompiledPr2(false).ParaPr; -W+=ParaPr.Ind.Left+ParaPr.Ind.FirstLine;return W};Paragraph.prototype.Change_Frame=function(X,Y,W,H,PageIndex){if(!this.LogicDocument||!this.CalculatedFrame||!this.CalculatedFrame.GetFramePr())return;var FramePr=this.CalculatedFrame.GetFramePr();if(Math.abs(Y-this.CalculatedFrame.T2)<.001&&Math.abs(X-this.CalculatedFrame.L2)<.001&&Math.abs(W-this.CalculatedFrame.W2)<.001&&Math.abs(H-this.CalculatedFrame.H2)<.001&&PageIndex===this.CalculatedFrame.PageIndex)return;var FrameParas=this.Internal_Get_FrameParagraphs(); -if(false===this.LogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_None,{Type:AscCommon.changestype_2_ElementsArray_and_Type,Elements:FrameParas,CheckType:AscCommon.changestype_Paragraph_Content})){this.LogicDocument.StartAction(AscDFH.historydescription_Document_ParagraphChangeFrame);var NewFramePr=FramePr.Copy();if(Math.abs(X-this.CalculatedFrame.L2)>.001){NewFramePr.X=X+(this.CalculatedFrame.L-this.CalculatedFrame.L2);NewFramePr.XAlign=undefined;NewFramePr.HAnchor=Asc.c_oAscHAnchor.Page}if(Math.abs(Y- -this.CalculatedFrame.T2)>.001){NewFramePr.Y=Y+(this.CalculatedFrame.T-this.CalculatedFrame.T2);NewFramePr.YAlign=undefined;NewFramePr.VAnchor=Asc.c_oAscVAnchor.Page}if(Math.abs(W-this.CalculatedFrame.W2)>.001)NewFramePr.W=W-Math.abs(this.CalculatedFrame.W2-this.CalculatedFrame.W);if(Math.abs(H-this.CalculatedFrame.H2)>.001)if(undefined!=FramePr.DropCap&&Asc.c_oAscDropCap.None!=FramePr.DropCap&&1===FrameParas.length){var PageH=this.LogicDocument.Get_PageLimits(PageIndex).YLimit;var _H=Math.min(H,PageH); -NewFramePr.Lines=this.Update_DropCapByHeight(_H);NewFramePr.HRule=linerule_Exact;NewFramePr.H=H-Math.abs(this.CalculatedFrame.H2-this.CalculatedFrame.H)}else{if(H<=this.CalculatedFrame.H2)NewFramePr.HRule=linerule_Exact;else NewFramePr.HRule=Asc.linerule_AtLeast;NewFramePr.H=H}var Count=FrameParas.length;for(var Index=0;Index0))return}};Paragraph.prototype.Split_DropCap=function(NewParagraph){var DropCapText=new CParagraphGetDropCapText;if(true==this.Selection.Use&&this.Parent.IsSelectedSingleElement()){var SelSP=this.Get_ParaContentPos(true,true);var SelEP=this.Get_ParaContentPos(true,false);if(0<=SelSP.Compare(SelEP))SelEP=SelSP;DropCapText.Check=true;this.Get_TextForDropCap(DropCapText,true,SelEP, -0);DropCapText.Check=false;this.Get_TextForDropCap(DropCapText,true,SelEP,0)}else{DropCapText.Mixed=true;DropCapText.Check=false;this.Get_TextForDropCap(DropCapText,false)}var Count=DropCapText.Text.length;var PrevRun=null;var CurrRun=null;for(var Pos=0,ParaPos=0,RunPos=0;Pos0)return DropCapText.Runs[Count-1].Get_CompiledPr(true);return null};Paragraph.prototype.SelectFirstLetter=function(){var oStartPos=new CParagraphContentPos;var oEndPos=new CParagraphContentPos;for(var nPos=0,nCount=this.Content.length;nPos0;CurPage--)if(Data.Pos>this.Lines[this.Pages[CurPage].StartLine].Get_StartPos())break;this.RecalcInfo.Set_Type_0(pararecalc_0_All);bNeedRecalc=true;break}case AscDFH.historyitem_Paragraph_Numbering:case AscDFH.historyitem_Paragraph_PStyle:case AscDFH.historyitem_Paragraph_Pr:case AscDFH.historyitem_Paragraph_PresentationPr_Bullet:case AscDFH.historyitem_Paragraph_PresentationPr_Level:{this.RecalcInfo.Set_Type_0(pararecalc_0_All); -bNeedRecalc=true;this.CompiledPr.NeedRecalc=true;this.Recalc_RunsCompiledPr();break}case AscDFH.historyitem_Paragraph_Align:case AscDFH.historyitem_Paragraph_DefaultTabSize:case AscDFH.historyitem_Paragraph_Ind_First:case AscDFH.historyitem_Paragraph_Ind_Left:case AscDFH.historyitem_Paragraph_Ind_Right:case AscDFH.historyitem_Paragraph_ContextualSpacing:case AscDFH.historyitem_Paragraph_KeepLines:case AscDFH.historyitem_Paragraph_KeepNext:case AscDFH.historyitem_Paragraph_PageBreakBefore:case AscDFH.historyitem_Paragraph_Spacing_Line:case AscDFH.historyitem_Paragraph_Spacing_LineRule:case AscDFH.historyitem_Paragraph_Spacing_Before:case AscDFH.historyitem_Paragraph_Spacing_After:case AscDFH.historyitem_Paragraph_Spacing_AfterAutoSpacing:case AscDFH.historyitem_Paragraph_Spacing_BeforeAutoSpacing:case AscDFH.historyitem_Paragraph_WidowControl:case AscDFH.historyitem_Paragraph_Tabs:case AscDFH.historyitem_Paragraph_Borders_Between:case AscDFH.historyitem_Paragraph_Borders_Bottom:case AscDFH.historyitem_Paragraph_Borders_Left:case AscDFH.historyitem_Paragraph_Borders_Right:case AscDFH.historyitem_Paragraph_Borders_Top:case AscDFH.historyitem_Paragraph_FramePr:{bNeedRecalc= +Paragraph.prototype.Document_CreateFontCharMap=function(FontCharMap){};Paragraph.prototype.Document_Get_AllFontNames=function(AllFonts){this.TextPr.Value.Document_Get_AllFontNames(AllFonts);if(this.Pr.Bullet)this.Pr.Bullet.Get_AllFontNames(AllFonts);if(this.Pr.DefaultRunPr)this.Pr.DefaultRunPr.Document_Get_AllFontNames(AllFonts);var Count=this.Content.length;for(var Index=0;IndexEndPos){StartPos=this.Selection.EndPos;EndPos=this.Selection.StartPos}for(var CurPos=StartPos;CurPos<=EndPos;CurPos++){var Element=this.Content[CurPos];if(true!==Element.IsSelectionEmpty()&&Element.Document_UpdateInterfaceState)Element.Document_UpdateInterfaceState()}}else{var CurType=this.Content[this.CurPos.ContentPos].Type;if(this.Content[this.CurPos.ContentPos].Document_UpdateInterfaceState)this.Content[this.CurPos.ContentPos].Document_UpdateInterfaceState()}var arrComplexFields=this.GetCurrentComplexFields(); +for(var nIndex=0,nCount=arrComplexFields.length;nIndex0)for(var ChangeIndex=0,ChangesCount=Changes.length;ChangeIndex=0&&StartPos.Compare(Change.get_EndPos())<=0){Change.put_InternalPos(_X,_Y,Page_abs);TrackManager.AddVisibleChange(Change)}}}}};Paragraph.prototype.PreDelete=function(){for(var Index=0;Index=Count)return{X:X0,Y:Y0,W:X1-X0,H:Y1-Y0};for(var Index=0;IndexX1)X1=_X1}var _Y1=Y1;var BottomBorder=Paras[Count-1].Get_CompiledPr2(false).ParaPr.Brd.Bottom;if(undefined!==BottomBorder&&border_None!==BottomBorder.Value)_Y1+=BottomBorder.Size+BottomBorder.Space;if(_Y1>Y1&&(Asc.linerule_Auto===FramePr.HRule||Asc.linerule_AtLeast===FramePr.HRule&&FrameH>=FramePr.H))Y1=_Y1;return{X:X0,Y:Y0,W:X1-X0,H:Y1-Y0}};Paragraph.prototype.SetCalculatedFrame=function(oFrame){this.CalculatedFrame= +oFrame;oFrame.AddParagraph(this)};Paragraph.prototype.GetCalculatedFrame=function(){return this.CalculatedFrame};Paragraph.prototype.Internal_Get_FrameParagraphs=function(){if(this.CalculatedFrame&&this.CalculatedFrame.GetParagraphs().length>0)return this.CalculatedFrame.GetParagraphs();var FrameParas=[];var FramePr=this.Get_FramePr();if(undefined===FramePr)return FrameParas;FrameParas.push(this);var Prev=this.Get_DocumentPrev();while(null!=Prev)if(type_Paragraph===Prev.GetType()){var PrevFramePr= +Prev.Get_FramePr();if(undefined!=PrevFramePr&&true===FramePr.Compare(PrevFramePr)){FrameParas.push(Prev);Prev=Prev.Get_DocumentPrev()}else break}else break;var Next=this.Get_DocumentNext();while(null!=Next)if(type_Paragraph===Next.GetType()){var NextFramePr=Next.Get_FramePr();if(undefined!=NextFramePr&&true===FramePr.Compare(NextFramePr)){FrameParas.push(Next);Next=Next.Get_DocumentNext()}else break}else break;return FrameParas};Paragraph.prototype.Is_LineDropCap=function(){var FrameParas=this.Internal_Get_FrameParagraphs(); +if(1!==FrameParas.length||1!==this.Lines.length)return false;return true};Paragraph.prototype.Get_LineDropCapWidth=function(){var W=this.Lines[0].Ranges[0].W;var ParaPr=this.Get_CompiledPr2(false).ParaPr;W+=ParaPr.Ind.Left+ParaPr.Ind.FirstLine;return W};Paragraph.prototype.Change_Frame=function(X,Y,W,H,PageIndex){if(!this.LogicDocument||!this.CalculatedFrame||!this.CalculatedFrame.GetFramePr())return;var FramePr=this.CalculatedFrame.GetFramePr();if(Math.abs(Y-this.CalculatedFrame.T2)<.001&&Math.abs(X- +this.CalculatedFrame.L2)<.001&&Math.abs(W-this.CalculatedFrame.W2)<.001&&Math.abs(H-this.CalculatedFrame.H2)<.001&&PageIndex===this.CalculatedFrame.PageIndex)return;var FrameParas=this.Internal_Get_FrameParagraphs();if(false===this.LogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_None,{Type:AscCommon.changestype_2_ElementsArray_and_Type,Elements:FrameParas,CheckType:AscCommon.changestype_Paragraph_Content})){this.LogicDocument.StartAction(AscDFH.historydescription_Document_ParagraphChangeFrame); +var NewFramePr=FramePr.Copy();if(Math.abs(X-this.CalculatedFrame.L2)>.001){NewFramePr.X=X+(this.CalculatedFrame.L-this.CalculatedFrame.L2);NewFramePr.XAlign=undefined;NewFramePr.HAnchor=Asc.c_oAscHAnchor.Page}if(Math.abs(Y-this.CalculatedFrame.T2)>.001){NewFramePr.Y=Y+(this.CalculatedFrame.T-this.CalculatedFrame.T2);NewFramePr.YAlign=undefined;NewFramePr.VAnchor=Asc.c_oAscVAnchor.Page}if(Math.abs(W-this.CalculatedFrame.W2)>.001)NewFramePr.W=W-Math.abs(this.CalculatedFrame.W2-this.CalculatedFrame.W); +if(Math.abs(H-this.CalculatedFrame.H2)>.001)if(undefined!=FramePr.DropCap&&Asc.c_oAscDropCap.None!=FramePr.DropCap&&1===FrameParas.length){var PageH=this.LogicDocument.Get_PageLimits(PageIndex).YLimit;var _H=Math.min(H,PageH);NewFramePr.Lines=this.Update_DropCapByHeight(_H);NewFramePr.HRule=linerule_Exact;NewFramePr.H=H-Math.abs(this.CalculatedFrame.H2-this.CalculatedFrame.H)}else{if(H<=this.CalculatedFrame.H2)NewFramePr.HRule=linerule_Exact;else NewFramePr.HRule=Asc.linerule_AtLeast;NewFramePr.H= +H}var Count=FrameParas.length;for(var Index=0;Index0))return}};Paragraph.prototype.Split_DropCap=function(NewParagraph){var DropCapText=new CParagraphGetDropCapText;if(true==this.Selection.Use&&this.Parent.IsSelectedSingleElement()){var SelSP= +this.Get_ParaContentPos(true,true);var SelEP=this.Get_ParaContentPos(true,false);if(0<=SelSP.Compare(SelEP))SelEP=SelSP;DropCapText.Check=true;this.Get_TextForDropCap(DropCapText,true,SelEP,0);DropCapText.Check=false;this.Get_TextForDropCap(DropCapText,true,SelEP,0)}else{DropCapText.Mixed=true;DropCapText.Check=false;this.Get_TextForDropCap(DropCapText,false)}var Count=DropCapText.Text.length;var PrevRun=null;var CurrRun=null;for(var Pos=0,ParaPos=0,RunPos=0;Pos0)return DropCapText.Runs[Count-1].Get_CompiledPr(true);return null};Paragraph.prototype.SelectFirstLetter=function(){var oStartPos=new CParagraphContentPos;var oEndPos=new CParagraphContentPos;for(var nPos=0,nCount=this.Content.length;nPos0;CurPage--)if(Data.Pos>this.Lines[this.Pages[CurPage].StartLine].Get_StartPos())break; +this.RecalcInfo.Set_Type_0(pararecalc_0_All);bNeedRecalc=true;break}case AscDFH.historyitem_Paragraph_Numbering:case AscDFH.historyitem_Paragraph_PStyle:case AscDFH.historyitem_Paragraph_Pr:case AscDFH.historyitem_Paragraph_PresentationPr_Bullet:case AscDFH.historyitem_Paragraph_PresentationPr_Level:{this.RecalcInfo.Set_Type_0(pararecalc_0_All);bNeedRecalc=true;this.CompiledPr.NeedRecalc=true;this.Recalc_RunsCompiledPr();break}case AscDFH.historyitem_Paragraph_Align:case AscDFH.historyitem_Paragraph_DefaultTabSize:case AscDFH.historyitem_Paragraph_Ind_First:case AscDFH.historyitem_Paragraph_Ind_Left:case AscDFH.historyitem_Paragraph_Ind_Right:case AscDFH.historyitem_Paragraph_ContextualSpacing:case AscDFH.historyitem_Paragraph_KeepLines:case AscDFH.historyitem_Paragraph_KeepNext:case AscDFH.historyitem_Paragraph_PageBreakBefore:case AscDFH.historyitem_Paragraph_Spacing_Line:case AscDFH.historyitem_Paragraph_Spacing_LineRule:case AscDFH.historyitem_Paragraph_Spacing_Before:case AscDFH.historyitem_Paragraph_Spacing_After:case AscDFH.historyitem_Paragraph_Spacing_AfterAutoSpacing:case AscDFH.historyitem_Paragraph_Spacing_BeforeAutoSpacing:case AscDFH.historyitem_Paragraph_WidowControl:case AscDFH.historyitem_Paragraph_Tabs:case AscDFH.historyitem_Paragraph_Borders_Between:case AscDFH.historyitem_Paragraph_Borders_Bottom:case AscDFH.historyitem_Paragraph_Borders_Left:case AscDFH.historyitem_Paragraph_Borders_Right:case AscDFH.historyitem_Paragraph_Borders_Top:case AscDFH.historyitem_Paragraph_FramePr:{bNeedRecalc= true;break}case AscDFH.historyitem_Paragraph_Shd_Value:case AscDFH.historyitem_Paragraph_Shd_Color:case AscDFH.historyitem_Paragraph_Shd_Unifill:case AscDFH.historyitem_Paragraph_Shd:{if(this.Parent){var oDrawingShape=this.Parent.Is_DrawingShape(true);if(oDrawingShape&&oDrawingShape.getObjectType&&oDrawingShape.getObjectType()===AscDFH.historyitem_type_Shape)if(oDrawingShape.chekBodyPrTransform(oDrawingShape.getBodyPr())||oDrawingShape.checkContentWordArt(oDrawingShape.getDocContent()))bNeedRecalc= true;if(this.Parent.IsTableHeader())bNeedRecalc=true}break}case AscDFH.historyitem_Paragraph_SectionPr:{if(this.Parent instanceof CDocument){this.Parent.UpdateContentIndexing();var nSectionIndex=this.Parent.GetSectionIndexByElementIndex(this.GetIndex());var oFirstElement=this.Parent.GetFirstElementInSection(nSectionIndex);if(oFirstElement)this.Parent.Refresh_RecalcData2(oFirstElement.GetIndex(),oFirstElement.private_GetRelativePageIndex(0))}break}case AscDFH.historyitem_Paragraph_PrChange:{if(Data instanceof CChangesParagraphPrChange&&Data.IsChangedNumbering())bNeedRecalc=true;break}case AscDFH.historyitem_Paragraph_SuppressLineNumbers:{History.AddLineNumbersToRecalculateData();break}}if(true===bNeedRecalc){var Prev=this.Get_DocumentPrev();if(0===CurPage&&null!=Prev&&type_Paragraph===Prev.GetType()&&true===Prev.Get_CompiledPr2(false).ParaPr.KeepNext)Prev.Refresh_RecalcData2(Prev.Pages.length-1);return this.Refresh_RecalcData2(CurPage)}};Paragraph.prototype.Refresh_RecalcData2=function(CurPage){if(!CurPage)CurPage= diff --git a/www/common/onlyoffice/v4/sdkjs/word/sdk-all.js b/www/common/onlyoffice/v4/sdkjs/word/sdk-all.js index 9cf50656c..7e0522775 100644 --- a/www/common/onlyoffice/v4/sdkjs/word/sdk-all.js +++ b/www/common/onlyoffice/v4/sdkjs/word/sdk-all.js @@ -14733,59 +14733,59 @@ this.CheckFootnote(X,Y,CurPage);if(isInText&&null!=oHyperlink&&(Y<=this.Pages[Cu Asc.c_oAscMouseMoveDataTypes.Common;if(isInText&&(null!=oHyperlink||bPageRefLink)&&true===AscCommon.global_keyboardEvent.CtrlKey)this.DrawingDocument.SetCursorType("pointer",MMData);else this.DrawingDocument.SetCursorType("text",MMData);var Bounds=this.Pages[CurPage].Bounds;if(true===this.Lock.Is_Locked()&&XBounds.Left&&Y>Bounds.Top&&YEndPos){StartPos=this.Selection.EndPos;EndPos=this.Selection.StartPos}for(var CurPos= -StartPos;CurPos<=EndPos;CurPos++){var Element=this.Content[CurPos];if(true!==Element.IsSelectionEmpty()&&Element.Document_UpdateInterfaceState)Element.Document_UpdateInterfaceState()}}else{var CurType=this.Content[this.CurPos.ContentPos].Type;if(this.Content[this.CurPos.ContentPos].Document_UpdateInterfaceState)this.Content[this.CurPos.ContentPos].Document_UpdateInterfaceState()}var arrComplexFields=this.GetCurrentComplexFields();for(var nIndex=0,nCount=arrComplexFields.length;nIndex0)for(var ChangeIndex=0,ChangesCount=Changes.length;ChangeIndex= -0&&StartPos.Compare(Change.get_EndPos())<=0){Change.put_InternalPos(_X,_Y,Page_abs);TrackManager.AddVisibleChange(Change)}}}}};Paragraph.prototype.PreDelete=function(){for(var Index=0;Index=Count)return{X:X0, -Y:Y0,W:X1-X0,H:Y1-Y0};for(var Index=0;IndexX1)X1=_X1}var _Y1=Y1;var BottomBorder=Paras[Count-1].Get_CompiledPr2(false).ParaPr.Brd.Bottom; -if(undefined!==BottomBorder&&border_None!==BottomBorder.Value)_Y1+=BottomBorder.Size+BottomBorder.Space;if(_Y1>Y1&&(Asc.linerule_Auto===FramePr.HRule||Asc.linerule_AtLeast===FramePr.HRule&&FrameH>=FramePr.H))Y1=_Y1;return{X:X0,Y:Y0,W:X1-X0,H:Y1-Y0}};Paragraph.prototype.SetCalculatedFrame=function(oFrame){this.CalculatedFrame=oFrame;oFrame.AddParagraph(this)};Paragraph.prototype.GetCalculatedFrame=function(){return this.CalculatedFrame};Paragraph.prototype.Internal_Get_FrameParagraphs=function(){if(this.CalculatedFrame&& -this.CalculatedFrame.GetParagraphs().length>0)return this.CalculatedFrame.GetParagraphs();var FrameParas=[];var FramePr=this.Get_FramePr();if(undefined===FramePr)return FrameParas;FrameParas.push(this);var Prev=this.Get_DocumentPrev();while(null!=Prev)if(type_Paragraph===Prev.GetType()){var PrevFramePr=Prev.Get_FramePr();if(undefined!=PrevFramePr&&true===FramePr.Compare(PrevFramePr)){FrameParas.push(Prev);Prev=Prev.Get_DocumentPrev()}else break}else break;var Next=this.Get_DocumentNext();while(null!= -Next)if(type_Paragraph===Next.GetType()){var NextFramePr=Next.Get_FramePr();if(undefined!=NextFramePr&&true===FramePr.Compare(NextFramePr)){FrameParas.push(Next);Next=Next.Get_DocumentNext()}else break}else break;return FrameParas};Paragraph.prototype.Is_LineDropCap=function(){var FrameParas=this.Internal_Get_FrameParagraphs();if(1!==FrameParas.length||1!==this.Lines.length)return false;return true};Paragraph.prototype.Get_LineDropCapWidth=function(){var W=this.Lines[0].Ranges[0].W;var ParaPr=this.Get_CompiledPr2(false).ParaPr; -W+=ParaPr.Ind.Left+ParaPr.Ind.FirstLine;return W};Paragraph.prototype.Change_Frame=function(X,Y,W,H,PageIndex){if(!this.LogicDocument||!this.CalculatedFrame||!this.CalculatedFrame.GetFramePr())return;var FramePr=this.CalculatedFrame.GetFramePr();if(Math.abs(Y-this.CalculatedFrame.T2)<.001&&Math.abs(X-this.CalculatedFrame.L2)<.001&&Math.abs(W-this.CalculatedFrame.W2)<.001&&Math.abs(H-this.CalculatedFrame.H2)<.001&&PageIndex===this.CalculatedFrame.PageIndex)return;var FrameParas=this.Internal_Get_FrameParagraphs(); -if(false===this.LogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_None,{Type:AscCommon.changestype_2_ElementsArray_and_Type,Elements:FrameParas,CheckType:AscCommon.changestype_Paragraph_Content})){this.LogicDocument.StartAction(AscDFH.historydescription_Document_ParagraphChangeFrame);var NewFramePr=FramePr.Copy();if(Math.abs(X-this.CalculatedFrame.L2)>.001){NewFramePr.X=X+(this.CalculatedFrame.L-this.CalculatedFrame.L2);NewFramePr.XAlign=undefined;NewFramePr.HAnchor=Asc.c_oAscHAnchor.Page}if(Math.abs(Y- -this.CalculatedFrame.T2)>.001){NewFramePr.Y=Y+(this.CalculatedFrame.T-this.CalculatedFrame.T2);NewFramePr.YAlign=undefined;NewFramePr.VAnchor=Asc.c_oAscVAnchor.Page}if(Math.abs(W-this.CalculatedFrame.W2)>.001)NewFramePr.W=W-Math.abs(this.CalculatedFrame.W2-this.CalculatedFrame.W);if(Math.abs(H-this.CalculatedFrame.H2)>.001)if(undefined!=FramePr.DropCap&&Asc.c_oAscDropCap.None!=FramePr.DropCap&&1===FrameParas.length){var PageH=this.LogicDocument.Get_PageLimits(PageIndex).YLimit;var _H=Math.min(H,PageH); -NewFramePr.Lines=this.Update_DropCapByHeight(_H);NewFramePr.HRule=linerule_Exact;NewFramePr.H=H-Math.abs(this.CalculatedFrame.H2-this.CalculatedFrame.H)}else{if(H<=this.CalculatedFrame.H2)NewFramePr.HRule=linerule_Exact;else NewFramePr.HRule=Asc.linerule_AtLeast;NewFramePr.H=H}var Count=FrameParas.length;for(var Index=0;Index0))return}};Paragraph.prototype.Split_DropCap=function(NewParagraph){var DropCapText=new CParagraphGetDropCapText;if(true==this.Selection.Use&&this.Parent.IsSelectedSingleElement()){var SelSP=this.Get_ParaContentPos(true,true);var SelEP=this.Get_ParaContentPos(true,false);if(0<=SelSP.Compare(SelEP))SelEP=SelSP;DropCapText.Check=true;this.Get_TextForDropCap(DropCapText,true,SelEP, -0);DropCapText.Check=false;this.Get_TextForDropCap(DropCapText,true,SelEP,0)}else{DropCapText.Mixed=true;DropCapText.Check=false;this.Get_TextForDropCap(DropCapText,false)}var Count=DropCapText.Text.length;var PrevRun=null;var CurrRun=null;for(var Pos=0,ParaPos=0,RunPos=0;Pos0)return DropCapText.Runs[Count-1].Get_CompiledPr(true);return null};Paragraph.prototype.SelectFirstLetter=function(){var oStartPos=new CParagraphContentPos;var oEndPos=new CParagraphContentPos;for(var nPos=0,nCount=this.Content.length;nPos0;CurPage--)if(Data.Pos>this.Lines[this.Pages[CurPage].StartLine].Get_StartPos())break;this.RecalcInfo.Set_Type_0(pararecalc_0_All);bNeedRecalc=true;break}case AscDFH.historyitem_Paragraph_Numbering:case AscDFH.historyitem_Paragraph_PStyle:case AscDFH.historyitem_Paragraph_Pr:case AscDFH.historyitem_Paragraph_PresentationPr_Bullet:case AscDFH.historyitem_Paragraph_PresentationPr_Level:{this.RecalcInfo.Set_Type_0(pararecalc_0_All); -bNeedRecalc=true;this.CompiledPr.NeedRecalc=true;this.Recalc_RunsCompiledPr();break}case AscDFH.historyitem_Paragraph_Align:case AscDFH.historyitem_Paragraph_DefaultTabSize:case AscDFH.historyitem_Paragraph_Ind_First:case AscDFH.historyitem_Paragraph_Ind_Left:case AscDFH.historyitem_Paragraph_Ind_Right:case AscDFH.historyitem_Paragraph_ContextualSpacing:case AscDFH.historyitem_Paragraph_KeepLines:case AscDFH.historyitem_Paragraph_KeepNext:case AscDFH.historyitem_Paragraph_PageBreakBefore:case AscDFH.historyitem_Paragraph_Spacing_Line:case AscDFH.historyitem_Paragraph_Spacing_LineRule:case AscDFH.historyitem_Paragraph_Spacing_Before:case AscDFH.historyitem_Paragraph_Spacing_After:case AscDFH.historyitem_Paragraph_Spacing_AfterAutoSpacing:case AscDFH.historyitem_Paragraph_Spacing_BeforeAutoSpacing:case AscDFH.historyitem_Paragraph_WidowControl:case AscDFH.historyitem_Paragraph_Tabs:case AscDFH.historyitem_Paragraph_Borders_Between:case AscDFH.historyitem_Paragraph_Borders_Bottom:case AscDFH.historyitem_Paragraph_Borders_Left:case AscDFH.historyitem_Paragraph_Borders_Right:case AscDFH.historyitem_Paragraph_Borders_Top:case AscDFH.historyitem_Paragraph_FramePr:{bNeedRecalc= +Paragraph.prototype.Document_CreateFontCharMap=function(FontCharMap){};Paragraph.prototype.Document_Get_AllFontNames=function(AllFonts){this.TextPr.Value.Document_Get_AllFontNames(AllFonts);if(this.Pr.Bullet)this.Pr.Bullet.Get_AllFontNames(AllFonts);if(this.Pr.DefaultRunPr)this.Pr.DefaultRunPr.Document_Get_AllFontNames(AllFonts);var Count=this.Content.length;for(var Index=0;IndexEndPos){StartPos=this.Selection.EndPos;EndPos=this.Selection.StartPos}for(var CurPos=StartPos;CurPos<=EndPos;CurPos++){var Element=this.Content[CurPos];if(true!==Element.IsSelectionEmpty()&&Element.Document_UpdateInterfaceState)Element.Document_UpdateInterfaceState()}}else{var CurType=this.Content[this.CurPos.ContentPos].Type;if(this.Content[this.CurPos.ContentPos].Document_UpdateInterfaceState)this.Content[this.CurPos.ContentPos].Document_UpdateInterfaceState()}var arrComplexFields=this.GetCurrentComplexFields(); +for(var nIndex=0,nCount=arrComplexFields.length;nIndex0)for(var ChangeIndex=0,ChangesCount=Changes.length;ChangeIndex=0&&StartPos.Compare(Change.get_EndPos())<=0){Change.put_InternalPos(_X,_Y,Page_abs);TrackManager.AddVisibleChange(Change)}}}}};Paragraph.prototype.PreDelete=function(){for(var Index=0;Index=Count)return{X:X0,Y:Y0,W:X1-X0,H:Y1-Y0};for(var Index=0;IndexX1)X1=_X1}var _Y1=Y1;var BottomBorder=Paras[Count-1].Get_CompiledPr2(false).ParaPr.Brd.Bottom;if(undefined!==BottomBorder&&border_None!==BottomBorder.Value)_Y1+=BottomBorder.Size+BottomBorder.Space;if(_Y1>Y1&&(Asc.linerule_Auto===FramePr.HRule||Asc.linerule_AtLeast===FramePr.HRule&&FrameH>=FramePr.H))Y1=_Y1;return{X:X0,Y:Y0,W:X1-X0,H:Y1-Y0}};Paragraph.prototype.SetCalculatedFrame=function(oFrame){this.CalculatedFrame= +oFrame;oFrame.AddParagraph(this)};Paragraph.prototype.GetCalculatedFrame=function(){return this.CalculatedFrame};Paragraph.prototype.Internal_Get_FrameParagraphs=function(){if(this.CalculatedFrame&&this.CalculatedFrame.GetParagraphs().length>0)return this.CalculatedFrame.GetParagraphs();var FrameParas=[];var FramePr=this.Get_FramePr();if(undefined===FramePr)return FrameParas;FrameParas.push(this);var Prev=this.Get_DocumentPrev();while(null!=Prev)if(type_Paragraph===Prev.GetType()){var PrevFramePr= +Prev.Get_FramePr();if(undefined!=PrevFramePr&&true===FramePr.Compare(PrevFramePr)){FrameParas.push(Prev);Prev=Prev.Get_DocumentPrev()}else break}else break;var Next=this.Get_DocumentNext();while(null!=Next)if(type_Paragraph===Next.GetType()){var NextFramePr=Next.Get_FramePr();if(undefined!=NextFramePr&&true===FramePr.Compare(NextFramePr)){FrameParas.push(Next);Next=Next.Get_DocumentNext()}else break}else break;return FrameParas};Paragraph.prototype.Is_LineDropCap=function(){var FrameParas=this.Internal_Get_FrameParagraphs(); +if(1!==FrameParas.length||1!==this.Lines.length)return false;return true};Paragraph.prototype.Get_LineDropCapWidth=function(){var W=this.Lines[0].Ranges[0].W;var ParaPr=this.Get_CompiledPr2(false).ParaPr;W+=ParaPr.Ind.Left+ParaPr.Ind.FirstLine;return W};Paragraph.prototype.Change_Frame=function(X,Y,W,H,PageIndex){if(!this.LogicDocument||!this.CalculatedFrame||!this.CalculatedFrame.GetFramePr())return;var FramePr=this.CalculatedFrame.GetFramePr();if(Math.abs(Y-this.CalculatedFrame.T2)<.001&&Math.abs(X- +this.CalculatedFrame.L2)<.001&&Math.abs(W-this.CalculatedFrame.W2)<.001&&Math.abs(H-this.CalculatedFrame.H2)<.001&&PageIndex===this.CalculatedFrame.PageIndex)return;var FrameParas=this.Internal_Get_FrameParagraphs();if(false===this.LogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_None,{Type:AscCommon.changestype_2_ElementsArray_and_Type,Elements:FrameParas,CheckType:AscCommon.changestype_Paragraph_Content})){this.LogicDocument.StartAction(AscDFH.historydescription_Document_ParagraphChangeFrame); +var NewFramePr=FramePr.Copy();if(Math.abs(X-this.CalculatedFrame.L2)>.001){NewFramePr.X=X+(this.CalculatedFrame.L-this.CalculatedFrame.L2);NewFramePr.XAlign=undefined;NewFramePr.HAnchor=Asc.c_oAscHAnchor.Page}if(Math.abs(Y-this.CalculatedFrame.T2)>.001){NewFramePr.Y=Y+(this.CalculatedFrame.T-this.CalculatedFrame.T2);NewFramePr.YAlign=undefined;NewFramePr.VAnchor=Asc.c_oAscVAnchor.Page}if(Math.abs(W-this.CalculatedFrame.W2)>.001)NewFramePr.W=W-Math.abs(this.CalculatedFrame.W2-this.CalculatedFrame.W); +if(Math.abs(H-this.CalculatedFrame.H2)>.001)if(undefined!=FramePr.DropCap&&Asc.c_oAscDropCap.None!=FramePr.DropCap&&1===FrameParas.length){var PageH=this.LogicDocument.Get_PageLimits(PageIndex).YLimit;var _H=Math.min(H,PageH);NewFramePr.Lines=this.Update_DropCapByHeight(_H);NewFramePr.HRule=linerule_Exact;NewFramePr.H=H-Math.abs(this.CalculatedFrame.H2-this.CalculatedFrame.H)}else{if(H<=this.CalculatedFrame.H2)NewFramePr.HRule=linerule_Exact;else NewFramePr.HRule=Asc.linerule_AtLeast;NewFramePr.H= +H}var Count=FrameParas.length;for(var Index=0;Index0))return}};Paragraph.prototype.Split_DropCap=function(NewParagraph){var DropCapText=new CParagraphGetDropCapText;if(true==this.Selection.Use&&this.Parent.IsSelectedSingleElement()){var SelSP= +this.Get_ParaContentPos(true,true);var SelEP=this.Get_ParaContentPos(true,false);if(0<=SelSP.Compare(SelEP))SelEP=SelSP;DropCapText.Check=true;this.Get_TextForDropCap(DropCapText,true,SelEP,0);DropCapText.Check=false;this.Get_TextForDropCap(DropCapText,true,SelEP,0)}else{DropCapText.Mixed=true;DropCapText.Check=false;this.Get_TextForDropCap(DropCapText,false)}var Count=DropCapText.Text.length;var PrevRun=null;var CurrRun=null;for(var Pos=0,ParaPos=0,RunPos=0;Pos0)return DropCapText.Runs[Count-1].Get_CompiledPr(true);return null};Paragraph.prototype.SelectFirstLetter=function(){var oStartPos=new CParagraphContentPos;var oEndPos=new CParagraphContentPos;for(var nPos=0,nCount=this.Content.length;nPos0;CurPage--)if(Data.Pos>this.Lines[this.Pages[CurPage].StartLine].Get_StartPos())break; +this.RecalcInfo.Set_Type_0(pararecalc_0_All);bNeedRecalc=true;break}case AscDFH.historyitem_Paragraph_Numbering:case AscDFH.historyitem_Paragraph_PStyle:case AscDFH.historyitem_Paragraph_Pr:case AscDFH.historyitem_Paragraph_PresentationPr_Bullet:case AscDFH.historyitem_Paragraph_PresentationPr_Level:{this.RecalcInfo.Set_Type_0(pararecalc_0_All);bNeedRecalc=true;this.CompiledPr.NeedRecalc=true;this.Recalc_RunsCompiledPr();break}case AscDFH.historyitem_Paragraph_Align:case AscDFH.historyitem_Paragraph_DefaultTabSize:case AscDFH.historyitem_Paragraph_Ind_First:case AscDFH.historyitem_Paragraph_Ind_Left:case AscDFH.historyitem_Paragraph_Ind_Right:case AscDFH.historyitem_Paragraph_ContextualSpacing:case AscDFH.historyitem_Paragraph_KeepLines:case AscDFH.historyitem_Paragraph_KeepNext:case AscDFH.historyitem_Paragraph_PageBreakBefore:case AscDFH.historyitem_Paragraph_Spacing_Line:case AscDFH.historyitem_Paragraph_Spacing_LineRule:case AscDFH.historyitem_Paragraph_Spacing_Before:case AscDFH.historyitem_Paragraph_Spacing_After:case AscDFH.historyitem_Paragraph_Spacing_AfterAutoSpacing:case AscDFH.historyitem_Paragraph_Spacing_BeforeAutoSpacing:case AscDFH.historyitem_Paragraph_WidowControl:case AscDFH.historyitem_Paragraph_Tabs:case AscDFH.historyitem_Paragraph_Borders_Between:case AscDFH.historyitem_Paragraph_Borders_Bottom:case AscDFH.historyitem_Paragraph_Borders_Left:case AscDFH.historyitem_Paragraph_Borders_Right:case AscDFH.historyitem_Paragraph_Borders_Top:case AscDFH.historyitem_Paragraph_FramePr:{bNeedRecalc= true;break}case AscDFH.historyitem_Paragraph_Shd_Value:case AscDFH.historyitem_Paragraph_Shd_Color:case AscDFH.historyitem_Paragraph_Shd_Unifill:case AscDFH.historyitem_Paragraph_Shd:{if(this.Parent){var oDrawingShape=this.Parent.Is_DrawingShape(true);if(oDrawingShape&&oDrawingShape.getObjectType&&oDrawingShape.getObjectType()===AscDFH.historyitem_type_Shape)if(oDrawingShape.chekBodyPrTransform(oDrawingShape.getBodyPr())||oDrawingShape.checkContentWordArt(oDrawingShape.getDocContent()))bNeedRecalc= true;if(this.Parent.IsTableHeader())bNeedRecalc=true}break}case AscDFH.historyitem_Paragraph_SectionPr:{if(this.Parent instanceof CDocument){this.Parent.UpdateContentIndexing();var nSectionIndex=this.Parent.GetSectionIndexByElementIndex(this.GetIndex());var oFirstElement=this.Parent.GetFirstElementInSection(nSectionIndex);if(oFirstElement)this.Parent.Refresh_RecalcData2(oFirstElement.GetIndex(),oFirstElement.private_GetRelativePageIndex(0))}break}case AscDFH.historyitem_Paragraph_PrChange:{if(Data instanceof CChangesParagraphPrChange&&Data.IsChangedNumbering())bNeedRecalc=true;break}case AscDFH.historyitem_Paragraph_SuppressLineNumbers:{History.AddLineNumbersToRecalculateData();break}}if(true===bNeedRecalc){var Prev=this.Get_DocumentPrev();if(0===CurPage&&null!=Prev&&type_Paragraph===Prev.GetType()&&true===Prev.Get_CompiledPr2(false).ParaPr.KeepNext)Prev.Refresh_RecalcData2(Prev.Pages.length-1);return this.Refresh_RecalcData2(CurPage)}};Paragraph.prototype.Refresh_RecalcData2=function(CurPage){if(!CurPage)CurPage=