Commit 3f2b9478 authored by Ilya Kirillov's avatar Ilya Kirillov

Сделано, чтобы элемент в ране отвечающий за ссылку на сноску обсчитывался и...

Сделано, чтобы элемент в ране отвечающий за ссылку на сноску обсчитывался и отрисовывался в стиле верхнего индекса.
parent af3747ea
...@@ -3070,6 +3070,8 @@ Paragraph.prototype = ...@@ -3070,6 +3070,8 @@ Paragraph.prototype =
case para_Tab: case para_Tab:
case para_Drawing: case para_Drawing:
case para_NewLine: case para_NewLine:
case para_FootnoteReference:
default:
{ {
// Элементы данного типа добавляем во внутренний элемент // Элементы данного типа добавляем во внутренний элемент
this.Content[this.CurPos.ContentPos].Add(Item); this.Content[this.CurPos.ContentPos].Add(Item);
......
...@@ -7474,6 +7474,9 @@ ParaPresentationNumbering.prototype = ...@@ -7474,6 +7474,9 @@ ParaPresentationNumbering.prototype =
function ParaFootnoteReference(sId) function ParaFootnoteReference(sId)
{ {
this.FootnoteId = sId; this.FootnoteId = sId;
this.Width = 0;
this.WidthVisible = 0;
} }
ParaFootnoteReference.prototype.Type = para_FootnoteReference; ParaFootnoteReference.prototype.Type = para_FootnoteReference;
ParaFootnoteReference.prototype.Get_Type = function() ParaFootnoteReference.prototype.Get_Type = function()
...@@ -7482,24 +7485,28 @@ ParaFootnoteReference.prototype.Get_Type = function() ...@@ -7482,24 +7485,28 @@ ParaFootnoteReference.prototype.Get_Type = function()
}; };
ParaFootnoteReference.prototype.Draw = function(X, Y, Context) ParaFootnoteReference.prototype.Draw = function(X, Y, Context)
{ {
Context.SetFontSlot(fontslot_ASCII, vertalign_Koef_Size);
Context.FillTextCode(X, Y, "1".charCodeAt(0));
}; };
ParaFootnoteReference.prototype.Measure = function(Context) ParaFootnoteReference.prototype.Measure = function(Context, TextPr)
{ {
Context.SetFontSlot(fontslot_ASCII, vertalign_Koef_Size);
var Temp = Context.MeasureCode("1".charCodeAt(0));
var ResultWidth = (Math.max((Temp.Width + TextPr.Spacing), 0) * TEXTWIDTH_DIVIDER) | 0;
this.Width = ResultWidth;
this.WidthVisible = ResultWidth;
}; };
ParaFootnoteReference.prototype.Get_Width = function() ParaFootnoteReference.prototype.Get_Width = function()
{ {
return 0; return (this.Width / TEXTWIDTH_DIVIDER);
}; };
ParaFootnoteReference.prototype.Get_WidthVisible = function() ParaFootnoteReference.prototype.Get_WidthVisible = function()
{ {
return 0; return (this.WidthVisible / TEXTWIDTH_DIVIDER);
}; };
ParaFootnoteReference.prototype.Set_WidthVisible = function(WidthVisible) ParaFootnoteReference.prototype.Set_WidthVisible = function(WidthVisible)
{ {
return 0; this.WidthVisible = (WidthVisible * TEXTWIDTH_DIVIDER) | 0;
//this.WidthVisible = WidthVisible;
}; };
ParaFootnoteReference.prototype.Is_RealContent = function() ParaFootnoteReference.prototype.Is_RealContent = function()
{ {
......
...@@ -1157,32 +1157,10 @@ ParaRun.prototype.Recalculate_CurPos = function(X, Y, CurrentRun, _CurRange, _Cu ...@@ -1157,32 +1157,10 @@ ParaRun.prototype.Recalculate_CurPos = function(X, Y, CurrentRun, _CurRange, _Cu
var Item = this.Content[Pos]; var Item = this.Content[Pos];
var ItemType = Item.Type; var ItemType = Item.Type;
switch( ItemType ) if (para_Drawing === ItemType && drawing_Inline !== Item.DrawingType)
{ continue;
case para_Text:
case para_Space:
case para_Sym:
case para_PageNum:
case para_Tab:
case para_End:
case para_NewLine:
case para_Math_Text:
case para_Math_BreakOperator:
case para_Math_Placeholder:
case para_Math_Ampersand:
{
X += Item.Get_WidthVisible();
break;
}
case para_Drawing:
{
if ( drawing_Inline != Item.DrawingType )
break;
X += Item.Get_WidthVisible(); X += Item.Get_WidthVisible();
break;
}
}
} }
} }
...@@ -2295,6 +2273,7 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) ...@@ -2295,6 +2273,7 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
{ {
case para_Sym: case para_Sym:
case para_Text: case para_Text:
case para_FootnoteReference:
{ {
// Отмечаем, что началось слово // Отмечаем, что началось слово
StartWord = true; StartWord = true;
...@@ -3134,6 +3113,7 @@ ParaRun.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _Cur ...@@ -3134,6 +3113,7 @@ ParaRun.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _Cur
case para_Sym: case para_Sym:
case para_Text: case para_Text:
case para_PageNum: case para_PageNum:
case para_FootnoteReference:
{ {
UpdateLineMetricsText = true; UpdateLineMetricsText = true;
break; break;
...@@ -3231,6 +3211,7 @@ ParaRun.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange) ...@@ -3231,6 +3211,7 @@ ParaRun.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange)
{ {
case para_Sym: case para_Sym:
case para_Text: case para_Text:
case para_FootnoteReference:
{ {
PRSC.Letters++; PRSC.Letters++;
...@@ -3381,6 +3362,7 @@ ParaRun.prototype.Recalculate_Range_Spaces = function(PRSA, _CurLine, _CurRange, ...@@ -3381,6 +3362,7 @@ ParaRun.prototype.Recalculate_Range_Spaces = function(PRSA, _CurLine, _CurRange,
{ {
case para_Sym: case para_Sym:
case para_Text: case para_Text:
case para_FootnoteReference:
{ {
var WidthVisible = 0; var WidthVisible = 0;
...@@ -4278,6 +4260,7 @@ ParaRun.prototype.Draw_HighLights = function(PDSH) ...@@ -4278,6 +4260,7 @@ ParaRun.prototype.Draw_HighLights = function(PDSH)
case para_Math_BreakOperator: case para_Math_BreakOperator:
case para_Math_Ampersand: case para_Math_Ampersand:
case para_Sym: case para_Sym:
case para_FootnoteReference:
{ {
if ( para_Drawing === ItemType && !Item.Is_Inline() ) if ( para_Drawing === ItemType && !Item.Is_Inline() )
break; break;
...@@ -4438,19 +4421,25 @@ ParaRun.prototype.Draw_Elements = function(PDSE) ...@@ -4438,19 +4421,25 @@ ParaRun.prototype.Draw_Elements = function(PDSE)
var ItemType = Item.Type; var ItemType = Item.Type;
var TempY = Y; var TempY = Y;
switch( CurTextPr.VertAlign )
{
case AscCommon.vertalign_SubScript:
{
Y -= vertalign_Koef_Sub * CurTextPr.FontSize * g_dKoef_pt_to_mm;
break; if (ItemType === para_FootnoteReference)
} {
case AscCommon.vertalign_SuperScript: Y -= vertalign_Koef_Super * CurTextPr.FontSize * g_dKoef_pt_to_mm;
}
else
{
switch (CurTextPr.VertAlign)
{ {
Y -= vertalign_Koef_Super * CurTextPr.FontSize * g_dKoef_pt_to_mm; case AscCommon.vertalign_SubScript:
{
break; Y -= vertalign_Koef_Sub * CurTextPr.FontSize * g_dKoef_pt_to_mm;
break;
}
case AscCommon.vertalign_SuperScript:
{
Y -= vertalign_Koef_Super * CurTextPr.FontSize * g_dKoef_pt_to_mm;
break;
}
} }
} }
...@@ -4461,6 +4450,7 @@ ParaRun.prototype.Draw_Elements = function(PDSE) ...@@ -4461,6 +4450,7 @@ ParaRun.prototype.Draw_Elements = function(PDSE)
case para_Tab: case para_Tab:
case para_Text: case para_Text:
case para_Sym: case para_Sym:
case para_FootnoteReference:
{ {
if (para_Tab === ItemType) if (para_Tab === ItemType)
{ {
...@@ -4731,6 +4721,7 @@ ParaRun.prototype.Draw_Lines = function(PDSL) ...@@ -4731,6 +4721,7 @@ ParaRun.prototype.Draw_Lines = function(PDSL)
case para_Tab: case para_Tab:
case para_Text: case para_Text:
case para_Sym: case para_Sym:
case para_FootnoteReference:
{ {
if ( para_Drawing != ItemType || Item.Is_Inline() ) if ( para_Drawing != ItemType || Item.Is_Inline() )
{ {
......
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