Commit 7c1da491 authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug with footnotes height on a second page of a table.

parent b3dffcbc
......@@ -2218,8 +2218,12 @@ CTable.prototype =
// Учтем верхнее поле ячейки
Y += CellMar.Top.W;
var YLimit = Pos.YLimit;
YLimit -= this.Pages[CurPage].FootnotesH;
// TODO: Здесь надо учитывать нижнюю границу ячейки и вычесть ее ширину из YLimit
return { X : Pos.X + CellInfo.X_content_start, XLimit : Pos.X + CellInfo.X_content_end, Y : Y, YLimit : Pos.YLimit, MaxTopBorder : MaxTopBorder };
return { X : Pos.X + CellInfo.X_content_start, XLimit : Pos.X + CellInfo.X_content_end, Y : Y, YLimit : YLimit, MaxTopBorder : MaxTopBorder };
},
Get_MaxTopBorder : function(RowIndex)
......
......@@ -86,7 +86,7 @@ CTable.prototype.Recalculate_Grid = function()
CTable.prototype.Save_RecalculateObject = function()
{
var RecalcObj = new CTableRecalculateObject();
RecalcObj.Save( this );
RecalcObj.Save(this);
return RecalcObj;
};
CTable.prototype.Load_RecalculateObject = function(RecalcObj)
......@@ -101,8 +101,7 @@ CTable.prototype.Prepare_RecalculateObject = function()
this.TableRowsBottom = [];
this.RowsInfo = [];
this.HeaderInfo =
{
this.HeaderInfo = {
Count : 0,
H : 0,
PageIndex : 0,
......@@ -115,10 +114,10 @@ CTable.prototype.Prepare_RecalculateObject = function()
this.MaxBotBorder = [];
this.MaxBotMargin = [];
this.RecalcInfo.Reset( true );
this.RecalcInfo.Reset(true);
var Count = this.Content.length;
for ( var Index = 0; Index < Count; Index++ )
for (var Index = 0; Index < Count; Index++)
{
this.Content[Index].Prepare_RecalculateObject();
}
......@@ -126,7 +125,7 @@ CTable.prototype.Prepare_RecalculateObject = function()
CTable.prototype.Start_FromNewPage = function()
{
this.Pages.length = 1;
this.Pages[0] = new CTablePage( 0, 0, 0, 0, 0, 0 );
this.Pages[0] = new CTablePage(0, 0, 0, 0, 0, 0);
this.HeaderInfo.Pages[0] = {};
this.HeaderInfo.Pages[0].Draw = false;
......@@ -150,7 +149,7 @@ CTable.prototype.Start_FromNewPage = function()
this.RowsInfo[0].MaxTopBorder[0] = 0.0;
// Обнуляем таблицу суммарных высот ячеек
for ( var Index = -1; Index < this.Content.length; Index++ )
for (var Index = -1; Index < this.Content.length; Index++)
{
this.TableRowsBottom[Index] = [];
this.TableRowsBottom[Index][0] = 0;
......@@ -159,12 +158,12 @@ CTable.prototype.Start_FromNewPage = function()
this.Pages[0].MaxBotBorder = 0;
this.Pages[0].BotBorders = [];
if ( this.Content.length > 0 )
if (this.Content.length > 0)
{
var CellsCount = this.Content[0].Get_CellsCount();
for ( var CurCell = 0; CurCell < CellsCount; CurCell++ )
for (var CurCell = 0; CurCell < CellsCount; CurCell++)
{
var Cell = this.Content[0].Get_Cell( CurCell );
var Cell = this.Content[0].Get_Cell(CurCell);
Cell.Content.Start_FromNewPage();
Cell.PagesCount = 2;
}
......@@ -2116,6 +2115,8 @@ CTable.prototype.private_RecalculatePage = function(CurPage)
nFootnotesHeight = oFootnotes.GetHeight(nPageAbs, nColumnAbs);
nSavedY = Y;
nSavedTableHeight = TableHeight;
this.Pages[CurPage].FootnotesH = nFootnotesHeight;
}
if ((0 === CurRow && true === this.Check_EmptyPages(CurPage - 1)) || CurRow != FirstRow || (CurRow === FirstRow && true === ResetStartElement))
......@@ -2376,6 +2377,8 @@ CTable.prototype.private_RecalculatePage = function(CurPage)
var nCurFootnotesHeight = oFootnotes ? oFootnotes.GetHeight(nPageAbs, nColumnAbs) : 0;
if (oFootnotes && nCurFootnotesHeight > nFootnotesHeight + 0.001)
{
this.Pages[CurPage].FootnotesH = nCurFootnotesHeight;
nFootnotesHeight = nCurFootnotesHeight;
bResetFootnotes = false;
Y = nSavedY;
......@@ -3036,6 +3039,7 @@ function CTablePage(X, Y, XLimit, YLimit, FirstRow, MaxTopBorder)
this.LastRow = FirstRow;
this.Height = 0;
this.LastRowSplit = false;
this.FootnotesH = 0;
}
CTablePage.prototype.Shift = function(Dx, Dy)
{
......
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