Commit 769d81fa authored by GoshaZotov's avatar GoshaZotov

Merge branch 'develop' of https://github.com/ONLYOFFICE/sdkjs into Feature/3d_area_chart

parents 01b37747 97891c31
......@@ -11419,7 +11419,7 @@ CDocument.prototype.AddFootnote = function()
var nDocPosType = this.Get_DocPosType();
if (docpostype_Content !== nDocPosType && docpostype_Footnotes !== nDocPosType)
return;
if (false === this.Document_Is_SelectionLocked(changestype_Paragraph_Content))
{
this.History.Create_NewPoint();
......@@ -11427,10 +11427,20 @@ CDocument.prototype.AddFootnote = function()
var nDocPosType = this.Get_DocPosType();
if (docpostype_Content === nDocPosType)
{
var oFootnote = this.Footnotes.CreateFootnote();
oFootnote.Paragraph_Add(new ParaFootnoteRef(oFootnote));
oFootnote.Paragraph_Add(new ParaSpace());
var oStyles = this.Get_Styles();
var oFootnote = this.Footnotes.CreateFootnote();
var oParagraph = oFootnote.Get_ElementByIndex(0);
oParagraph.Style_Add(oStyles.GetDefaultFootnoteText());
var oRun = new ParaRun(oParagraph, false);
oRun.Set_RStyle(oStyles.GetDefaultFootnoteReference());
oRun.Add_ToContent(0, new ParaFootnoteRef(oFootnote));
oParagraph.Add_ToContent(0, oRun);
oRun = new ParaRun(oParagraph, false);
oRun.Add_ToContent(0, new ParaSpace());
oParagraph.Add_ToContent(1, oRun);
oFootnote.Cursor_MoveToEndPos(false);
this.Paragraph_Add(new ParaFootnoteReference(oFootnote));
this.Set_DocPosType(docpostype_Footnotes);
......
......@@ -1256,8 +1256,11 @@ CFootnotesController.prototype.AddFootnoteRef = function()
if (!oParagraph)
return;
var oStyles = this.LogicDocument.Get_Styles();
var oRun = new ParaRun(oParagraph, false);
oRun.Add_ToContent(0, new ParaFootnoteRef(oFootnote), false);
oRun.Set_RStyle(oStyles.GetDefaultFootnoteReference());
oParagraph.Add_ToContent(0, oRun);
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -7590,8 +7590,14 @@ ParaFootnoteReference.prototype.Get_Type = function()
};
ParaFootnoteReference.prototype.Draw = function(X, Y, Context, PDSE)
{
Context.SetFontSlot(fontslot_ASCII, vertalign_Koef_Size);
g_oTextMeasurer.SetFontSlot(fontslot_ASCII, vertalign_Koef_Size);
var TextPr = this.Run.Get_CompiledPr(false);
var FontKoef = 1;
if (TextPr.VertAlign !== AscCommon.vertalign_Baseline)
FontKoef = vertalign_Koef_Size;
Context.SetFontSlot(fontslot_ASCII, FontKoef);
g_oTextMeasurer.SetFontSlot(fontslot_ASCII, FontKoef);
var _X = X;
var T = this.private_GetString();
......@@ -7689,8 +7695,12 @@ ParaFootnoteReference.prototype.private_Measure = function()
var TextPr = this.Run.Get_CompiledPr(false);
var Theme = this.Run.Get_Paragraph().Get_Theme();
var FontKoef = 1;
if (TextPr.VertAlign !== AscCommon.vertalign_Baseline)
FontKoef = vertalign_Koef_Size;
oMeasurer.SetTextPr(TextPr, Theme);
oMeasurer.SetFontSlot(fontslot_ASCII, vertalign_Koef_Size);
oMeasurer.SetFontSlot(fontslot_ASCII, FontKoef);
var X = 0;
var T = this.private_GetString();
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment