Commit 34d547b9 authored by Ilya Kirillov's avatar Ilya Kirillov

Implemented NumFormat value for indexing of a footnotes.

parent 9f7bc1ae
......@@ -7578,6 +7578,7 @@ function ParaFootnoteReference(Footnote, CustomMark)
this.Width = 0;
this.WidthVisible = 0;
this.Number = 1;
this.NumFormat = numbering_numfmt_Decimal;
this.Run = null;
}
......@@ -7592,9 +7593,8 @@ ParaFootnoteReference.prototype.Draw = function(X, Y, Context, PDSE)
Context.SetFontSlot(fontslot_ASCII, vertalign_Koef_Size);
g_oTextMeasurer.SetFontSlot(fontslot_ASCII, vertalign_Koef_Size);
// TODO: Пока делаем обычный вариант с типом Decimal
var _X = X;
var T = Numbering_Number_To_String(this.Number);
var T = this.private_GetString();
for (var nPos = 0; nPos < T.length; ++nPos)
{
var Char = T.charAt(nPos);
......@@ -7668,10 +7668,13 @@ ParaFootnoteReference.prototype.UpdateNumber = function(PRS)
var nColumnAbs = PRS.GetColumnAbs();
var nAdditional = PRS.GetFootnoteReferencesCount(this);
var oSectPr = PRS.GetSectPr();
var nNumFormat = oSectPr.GetFootnoteNumFormat();
var oLogicDocument = this.Footnote.Get_LogicDocument();
var oLogicDocument = this.Footnote.Get_LogicDocument();
var oFootnotesController = oLogicDocument.GetFootnotesController();
this.Number = oFootnotesController.GetFootnoteNumberOnPage(nPageAbs, nColumnAbs, oSectPr) + nAdditional;
this.NumFormat = nNumFormat;
this.Number = oFootnotesController.GetFootnoteNumberOnPage(nPageAbs, nColumnAbs, oSectPr) + nAdditional;
this.private_Measure();
this.Footnote.SetNumber(this.Number, oSectPr);
}
......@@ -7689,9 +7692,8 @@ ParaFootnoteReference.prototype.private_Measure = function()
oMeasurer.SetTextPr(TextPr, Theme);
oMeasurer.SetFontSlot(fontslot_ASCII, vertalign_Koef_Size);
// TODO: Пока делаем обычный вариант с типом Decimal
var X = 0;
var T = Numbering_Number_To_String(this.Number);
var T = this.private_GetString();
for (var nPos = 0; nPos < T.length; ++nPos)
{
var Char = T.charAt(nPos);
......@@ -7702,6 +7704,21 @@ ParaFootnoteReference.prototype.private_Measure = function()
this.Width = ResultWidth;
this.WidthVisible = ResultWidth;
};
ParaFootnoteReference.prototype.private_GetString = function()
{
if (numbering_numfmt_Decimal === this.NumFormat)
return Numbering_Number_To_String(this.Number);
if (numbering_numfmt_LowerRoman === this.NumFormat)
return Numbering_Number_To_Roman(this.Number, true);
else if (numbering_numfmt_UpperRoman === this.NumFormat)
return Numbering_Number_To_Roman(this.Number, false);
else if (numbering_numfmt_LowerLetter === this.NumFormat)
return Numbering_Number_To_Alpha(this.Number, true);
else if (numbering_numfmt_UpperLetter === this.NumFormat)
return Numbering_Number_To_Alpha(this.Number, false);
else// if (numbering_numfmt_Decimal === this.NumFormat)
return Numbering_Number_To_String(this.Number);
};
/**
* Класс представляющий номер сноски внутри сноски.
......@@ -7727,7 +7744,8 @@ ParaFootnoteRef.prototype.UpdateNumber = function()
{
if (this.Footnote)
{
this.Number = this.Footnote.GetNumber();
this.Number = this.Footnote.GetNumber();
this.NumFormat = this.Footnote.GetReferenceSectPr().GetFootnoteNumFormat();
this.private_Measure();
}
};
......
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