Commit 7f7c6f78 authored by Ilya Kirillov's avatar Ilya Kirillov Committed by Alexander.Trofimov

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

Сделано, чтобы элемент в ране отвечающий за ссылку на сноску обсчитывался и отрисовывался в стиле верхнего индекса.
parent 6cb684d1
...@@ -3046,6 +3046,8 @@ Paragraph.prototype = ...@@ -3046,6 +3046,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);
......
...@@ -7450,6 +7450,9 @@ ParaPresentationNumbering.prototype = ...@@ -7450,6 +7450,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()
...@@ -7458,24 +7461,28 @@ ParaFootnoteReference.prototype.Get_Type = function() ...@@ -7458,24 +7461,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()
{ {
......
...@@ -1133,32 +1133,10 @@ ParaRun.prototype.Recalculate_CurPos = function(X, Y, CurrentRun, _CurRange, _Cu ...@@ -1133,32 +1133,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;
}
}
} }
} }
...@@ -2271,6 +2249,7 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) ...@@ -2271,6 +2249,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;
...@@ -3110,6 +3089,7 @@ ParaRun.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _Cur ...@@ -3110,6 +3089,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;
...@@ -3207,6 +3187,7 @@ ParaRun.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange) ...@@ -3207,6 +3187,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++;
...@@ -3357,6 +3338,7 @@ ParaRun.prototype.Recalculate_Range_Spaces = function(PRSA, _CurLine, _CurRange, ...@@ -3357,6 +3338,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;
...@@ -4254,6 +4236,7 @@ ParaRun.prototype.Draw_HighLights = function(PDSH) ...@@ -4254,6 +4236,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;
...@@ -4414,21 +4397,27 @@ ParaRun.prototype.Draw_Elements = function(PDSE) ...@@ -4414,21 +4397,27 @@ ParaRun.prototype.Draw_Elements = function(PDSE)
var ItemType = Item.Type; var ItemType = Item.Type;
var TempY = Y; var TempY = Y;
switch( CurTextPr.VertAlign )
if (ItemType === para_FootnoteReference)
{
Y -= vertalign_Koef_Super * CurTextPr.FontSize * g_dKoef_pt_to_mm;
}
else
{
switch (CurTextPr.VertAlign)
{ {
case AscCommon.vertalign_SubScript: case AscCommon.vertalign_SubScript:
{ {
Y -= vertalign_Koef_Sub * CurTextPr.FontSize * g_dKoef_pt_to_mm; Y -= vertalign_Koef_Sub * CurTextPr.FontSize * g_dKoef_pt_to_mm;
break; break;
} }
case AscCommon.vertalign_SuperScript: case AscCommon.vertalign_SuperScript:
{ {
Y -= vertalign_Koef_Super * CurTextPr.FontSize * g_dKoef_pt_to_mm; Y -= vertalign_Koef_Super * CurTextPr.FontSize * g_dKoef_pt_to_mm;
break; break;
} }
} }
}
switch( ItemType ) switch( ItemType )
{ {
...@@ -4437,6 +4426,7 @@ ParaRun.prototype.Draw_Elements = function(PDSE) ...@@ -4437,6 +4426,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)
{ {
...@@ -4707,6 +4697,7 @@ ParaRun.prototype.Draw_Lines = function(PDSL) ...@@ -4707,6 +4697,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