Commit b17d0192 authored by Ilya Kirillov's avatar Ilya Kirillov

Implemented positioning a footnote beneath text.

parent 1ce6ac75
...@@ -1549,8 +1549,6 @@ CDocument.prototype.On_EndLoad = function() ...@@ -1549,8 +1549,6 @@ CDocument.prototype.On_EndLoad = function()
{ {
this.Set_FastCollaborativeEditing(true); this.Set_FastCollaborativeEditing(true);
} }
//this.Footnotes.ResetSpecialFootnotes();
}; };
CDocument.prototype.Add_TestDocument = function() CDocument.prototype.Add_TestDocument = function()
{ {
...@@ -2754,7 +2752,7 @@ CDocument.prototype.Recalculate_PageColumn = function() ...@@ -2754,7 +2752,7 @@ CDocument.prototype.Recalculate_PageColumn = function()
if (Index >= Count || _PageIndex > PageIndex || _ColumnIndex > ColumnIndex) if (Index >= Count || _PageIndex > PageIndex || _ColumnIndex > ColumnIndex)
{ {
this.private_RecalculateShiftFootnotes(PageIndex, ColumnIndex); this.private_RecalculateShiftFootnotes(PageIndex, ColumnIndex, Y, SectPr);
} }
if (true === bReDraw) if (true === bReDraw)
...@@ -2869,11 +2867,23 @@ CDocument.prototype.private_RecalculateIsNewSection = function(nPageAbs, nConten ...@@ -2869,11 +2867,23 @@ CDocument.prototype.private_RecalculateIsNewSection = function(nPageAbs, nConten
return bNewSection; return bNewSection;
}; };
CDocument.prototype.private_RecalculateShiftFootnotes = function(nPageAbs, nColumnAbs) CDocument.prototype.private_RecalculateShiftFootnotes = function(nPageAbs, nColumnAbs, dY, oSectPr)
{ {
var dFootnotesHeight = this.Footnotes.GetHeight(nPageAbs, nColumnAbs); var nPosType = oSectPr.GetFootnotePos();
var oPageMetrics = this.Get_PageContentStartPos(nPageAbs);
this.Footnotes.Shift(nPageAbs, nColumnAbs, 0, oPageMetrics.YLimit - dFootnotesHeight); // section_footnote_PosDocEnd, section_footnote_PosSectEnd ненужные константы по логике, но Word воспринимает их
// именно как section_footnote_PosBeneathText, в то время как все остальное (даже константа не по формату)
// воспринимает как section_footnote_PosPageBottom.
if (section_footnote_PosBeneathText === nPosType || section_footnote_PosDocEnd === nPosType || section_footnote_PosSectEnd === nPosType)
{
this.Footnotes.Shift(nPageAbs, nColumnAbs, 0, dY);
}
else
{
var dFootnotesHeight = this.Footnotes.GetHeight(nPageAbs, nColumnAbs);
var oPageMetrics = this.Get_PageContentStartPos(nPageAbs);
this.Footnotes.Shift(nPageAbs, nColumnAbs, 0, oPageMetrics.YLimit - dFootnotesHeight);
}
}; };
CDocument.prototype.private_RecalculateFlowTable = function(RecalcInfo) CDocument.prototype.private_RecalculateFlowTable = function(RecalcInfo)
{ {
......
...@@ -177,6 +177,11 @@ CSectionPr.prototype = ...@@ -177,6 +177,11 @@ CSectionPr.prototype =
var Column = Other.Columns.Cols[ColumnIndex]; var Column = Other.Columns.Cols[ColumnIndex];
this.Set_Columns_Col(ColumnIndex, Column.W, Column.Space); this.Set_Columns_Col(ColumnIndex, Column.W, Column.Space);
} }
this.SetFootnotePos(Other.FootnotePr.Pos);
this.SetFootnoteNumStart(Other.FootnotePr.NumStart);
this.SetFootnoteNumRestart(Other.FootnotePr.NumRestart);
this.SetFootnoteNumFormat(Other.FootnotePr.NumFormat);
}, },
Clear_AllHdrFtr : function() Clear_AllHdrFtr : function()
...@@ -1867,7 +1872,7 @@ CSectionPr.prototype.SetFootnotePos = function(nPos) ...@@ -1867,7 +1872,7 @@ CSectionPr.prototype.SetFootnotePos = function(nPos)
CSectionPr.prototype.GetFootnotePos = function() CSectionPr.prototype.GetFootnotePos = function()
{ {
if (undefined === this.FootnotePr.Pos) if (undefined === this.FootnotePr.Pos)
return this.private_GetDocumentWideFootnotePr().Pos; return section_footnote_PosPageBottom;
return this.FootnotePr.Pos; return this.FootnotePr.Pos;
}; };
......
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