Commit a2b46da7 authored by Ilya Kirillov's avatar Ilya Kirillov

Implemented increasing of index number of footnote reference.

parent e8c2ebc5
......@@ -313,21 +313,27 @@ CFootnotesController.prototype.RemoveFootnoteFromPage = function(nPageAbs, nColu
}
}
};
CFootnotesController.prototype.GetFootnoteNumberOnPage = function(nPageAbs, oFootnote)
CFootnotesController.prototype.GetFootnoteNumberOnPage = function(nPageAbs, nColumnAbs, oFootnote)
{
if (!this.Pages[nPageAbs])
var oPage = this.Pages[nPageAbs];
if (!oPage)
return 1;
if (oFootnote)
var nFootnoteIndex = 1;
for (var nColumnIndex = 0, nColumnsCount = oPage.Columns.length; nColumnIndex <= Math.min(nColumnAbs, nColumnsCount - 1); ++nColumnIndex)
{
for (var nIndex = 0, nCount = this.Pages[nPageAbs].Elements.length; nIndex < nCount; ++nIndex)
var oColumn = oPage.Columns[nColumnIndex];
for (var nIndex = 0, nCount = oColumn.Elements.length; nIndex < nCount; ++nIndex)
{
if (oFootnote === this.Pages[nPageAbs].Elements[nIndex])
return nIndex + 1;
if (oFootnote && oFootnote === oColumn.Elements[nIndex])
return nFootnoteIndex;
nFootnoteIndex++;
}
}
return this.Pages[nPageAbs].Elements.length;
return nFootnoteIndex;
};
/**
* Проверяем, используется заданная сноска в документе.
......
......@@ -7641,13 +7641,13 @@ ParaFootnoteReference.prototype.Get_Footnote = function()
{
return this.Footnote;
};
ParaFootnoteReference.prototype.UpdateNumber = function(PageAbs)
ParaFootnoteReference.prototype.UpdateNumber = function(nPageAbs, nColumnAbs)
{
if (this.Footnote)
{
var oLogicDocument = this.Footnote.Get_LogicDocument();
var oFootnotesController = oLogicDocument.GetFootnotesController();
this.Number = oFootnotesController.GetFootnoteNumberOnPage(PageAbs, this.Footnote);
this.Number = oFootnotesController.GetFootnoteNumberOnPage(nPageAbs, nColumnAbs, this.Footnote);
this.private_Measure();
}
};
......
......@@ -2343,12 +2343,12 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
if (para_FootnoteReference === ItemType)
{
Item.UpdateNumber(Para.Get_AbsolutePage(PRS.Page));
Item.UpdateNumber(Para.Get_AbsolutePage(PRS.Page), Para.Get_AbsoluteColumn(PRS.Page));
PRS.Add_FootnoteReference(Item, Pos);
}
else if (para_FootnoteRef === ItemType)
{
Item.UpdateNumber(Para.Get_AbsolutePage(PRS.Page));
Item.UpdateNumber(Para.Get_AbsolutePage(PRS.Page), Para.Get_AbsoluteColumn(PRS.Page));
}
// При проверке, убирается ли слово, мы должны учитывать ширину предшествующих пробелов.
......
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