mirror of
https://github.com/ONLYOFFICE/sdkjs.git
synced 2026-04-07 14:09:12 +08:00
@ -6310,9 +6310,48 @@ CDocument.prototype.EditOleObject = function(oOleObject, sData, sImageUrl, fWidt
|
||||
{
|
||||
oOleObject.editExternal(sData, sImageUrl, fWidth, fHeight, nPixWidth, nPixHeight, arrImagesForAddToHistory);
|
||||
};
|
||||
CDocument.prototype.AddTextArt = function(nStyle)
|
||||
CDocument.prototype.AddTextArt = function(textArtStyle)
|
||||
{
|
||||
this.Controller.AddTextArt(nStyle);
|
||||
let curParagraph = this.GetCurrentParagraph();
|
||||
if (!curParagraph)
|
||||
return;
|
||||
|
||||
let drawing = new AscWord.ParaDrawing(1828800 / 36000, 1828800 / 36000, null, this.DrawingDocument, this, null);
|
||||
let textArt = this.DrawingObjects.createTextArt(textArtStyle, true);
|
||||
textArt.setParent(drawing);
|
||||
drawing.Set_GraphicObject(textArt);
|
||||
drawing.Set_DrawingType(drawing_Anchor);
|
||||
drawing.Set_WrappingType(WRAPPING_TYPE_NONE);
|
||||
drawing.Set_BehindDoc(false);
|
||||
drawing.Set_Distance(3.2, 0, 3.2, 0);
|
||||
drawing.Set_PositionV(Asc.c_oAscRelativeFromV.Paragraph, false, 0, false);
|
||||
|
||||
if (curParagraph.isRtlDirection())
|
||||
drawing.Set_PositionH(Asc.c_oAscRelativeFromH.Column, true, Asc.c_oAscAlignH.Right, false);
|
||||
else
|
||||
drawing.Set_PositionH(Asc.c_oAscRelativeFromH.Column, false, 0, false);
|
||||
|
||||
let docContent = textArt.getDocContent();
|
||||
let directParaPr = curParagraph.GetDirectParaPr(false);
|
||||
if (undefined !== directParaPr.Bidi)
|
||||
{
|
||||
docContent.GetAllParagraphs().forEach(function(p){
|
||||
p.SetParagraphBidi(directParaPr.Bidi);
|
||||
});
|
||||
}
|
||||
|
||||
this.RemoveBeforePaste();
|
||||
|
||||
this.AddToParagraph(drawing);
|
||||
if (textArt.bSelectedText)
|
||||
{
|
||||
this.Select_DrawingObject(drawing.GetId());
|
||||
}
|
||||
else
|
||||
{
|
||||
docContent.SelectAll();
|
||||
docContent.SetThisElementCurrent();
|
||||
}
|
||||
};
|
||||
|
||||
CDocument.prototype.AddSignatureLine = function(oSignatureDrawing){
|
||||
@ -19756,42 +19795,6 @@ CDocument.prototype.controller_AddOleObject = function(W, H, nWidthPix, nHeightP
|
||||
}
|
||||
return Drawing;
|
||||
};
|
||||
CDocument.prototype.controller_AddTextArt = function(nStyle)
|
||||
{
|
||||
var Item = this.Content[this.CurPos.ContentPos];
|
||||
if (type_Paragraph == Item.GetType())
|
||||
{
|
||||
var Drawing = new ParaDrawing(1828800 / 36000, 1828800 / 36000, null, this.DrawingDocument, this, null);
|
||||
var TextArt = this.DrawingObjects.createTextArt(nStyle, true);
|
||||
TextArt.setParent(Drawing);
|
||||
Drawing.Set_GraphicObject(TextArt);
|
||||
Drawing.Set_DrawingType(drawing_Anchor);
|
||||
Drawing.Set_WrappingType(WRAPPING_TYPE_NONE);
|
||||
Drawing.Set_BehindDoc(false);
|
||||
Drawing.Set_Distance(3.2, 0, 3.2, 0);
|
||||
Drawing.Set_PositionH(Asc.c_oAscRelativeFromH.Column, false, 0, false);
|
||||
Drawing.Set_PositionV(Asc.c_oAscRelativeFromV.Paragraph, false, 0, false);
|
||||
|
||||
if (true == this.Selection.Use)
|
||||
this.Remove(1, true);
|
||||
|
||||
this.AddToParagraph(Drawing);
|
||||
if (TextArt.bSelectedText)
|
||||
{
|
||||
this.Select_DrawingObject(Drawing.Get_Id());
|
||||
}
|
||||
else
|
||||
{
|
||||
var oContent = Drawing.GraphicObj.getDocContent();
|
||||
oContent.Content[0].Document_SetThisElementCurrent(false);
|
||||
this.SelectAll();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Item.AddTextArt(nStyle);
|
||||
}
|
||||
};
|
||||
CDocument.prototype.controller_AddSignatureLine = function(oSignatureDrawing)
|
||||
{
|
||||
var Item = this.Content[this.CurPos.ContentPos];
|
||||
|
||||
@ -73,10 +73,6 @@ CLogicDocumentController.prototype.AddOleObject = function(nW, nH, nWidthPix, nH
|
||||
{
|
||||
return this.LogicDocument.controller_AddOleObject(nW, nH, nWidthPix, nHeightPix, oImage, oData, sApplicationId, bSelect, arrImagesForAddToHistory);
|
||||
};
|
||||
CLogicDocumentController.prototype.AddTextArt = function(nStyle)
|
||||
{
|
||||
this.LogicDocument.controller_AddTextArt(nStyle);
|
||||
};
|
||||
CLogicDocumentController.prototype.EditChart = function(Chart)
|
||||
{
|
||||
// Ничего не делаем
|
||||
|
||||
@ -4272,3 +4272,7 @@ CAnchorPosition.prototype.Calculate_Y_Value = function(RelativeFrom)
|
||||
//--------------------------------------------------------export----------------------------------------------------
|
||||
window['AscCommonWord'] = window['AscCommonWord'] || {};
|
||||
window['AscCommonWord'].ParaDrawing = ParaDrawing;
|
||||
|
||||
window['AscWord'] = window['AscWord'] || {};
|
||||
window['AscWord'].ParaDrawing = ParaDrawing;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user