Commit 38a8a620 authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug with recalculating document if changes had been made in a footnote....

Fixed bug with recalculating document if changes had been made in a footnote. Fixed bug with start position for the second page of a single footnote. Fixed bug with recalculating columns/pages with no any space on it because of a big footnote.
parent 942fbc58
......@@ -1674,7 +1674,7 @@ CDocument.prototype.Get_PageContentStartPos2 = function(StartPageIndex, St
var ColumnAbs = (StartColumnIndex + ElementPageIndex) - ((StartColumnIndex + ElementPageIndex) / ColumnsCount | 0) * ColumnsCount;
var PageAbs = StartPageIndex + ((StartColumnIndex + ElementPageIndex) / ColumnsCount | 0);
var FootnotesHeight = this.Footnotes.GetHeight(StartPageIndex, ColumnAbs);
var FootnotesHeight = this.Footnotes.GetHeight(PageAbs, ColumnAbs);
var Y = SectPr.Get_PageMargin_Top();
var YLimit = SectPr.Get_PageHeight() - SectPr.Get_PageMargin_Bottom() - FootnotesHeight;
......
......@@ -60,6 +60,10 @@ CFootEndnote.prototype.Get_PageContentStartPos = function(nCurPage)
var nColumnAbs = this.Get_AbsoluteColumn(nCurPage);
return this.Parent.Get_PageContentStartPos(nPageAbs, nColumnAbs);
};
CFootEndnote.prototype.Refresh_RecalcData2 = function(nIndex, nCurPage)
{
this.Parent.Refresh_RecalcData2(this.Get_AbsolutePage(nCurPage));
};
CFootEndnote.prototype.Write_ToBinary2 = function(Writer)
{
Writer.WriteLong(AscDFH.historyitem_type_FootEndNote);
......
......@@ -1348,9 +1348,14 @@ Paragraph.prototype.private_RecalculateLineBottomBound = function(CurLine, CurPa
var RealCurPage = this.private_GetRelativePageIndex(CurPage) - this.Get_StartPage_Relative();
// TODO: Здесь надо бы ускорить эту проверку
var bNoFootnotes = true;
if (this.Parent instanceof CDocument && this.Parent.Footnotes.GetHeight(this.Get_AbsolutePage(CurPage), this.Get_AbsoluteColumn(CurPage)) > 0.001)
bNoFootnotes = false;
// Сначала проверяем не нужно ли сделать перенос страницы в данном месте
// Перенос не делаем, если это первая строка на новой странице
if (true === this.Use_YLimit() && (Top > PRS.YLimit || Bottom2 > PRS.YLimit) && (CurLine != this.Pages[CurPage].FirstLine || (0 === RealCurPage && (null != this.Get_DocumentPrev() || (true === this.Parent.Is_TableCellContent() && true !== this.Parent.Is_TableFirstRowOnNewPage())))) && false === BreakPageLineEmpty)
if (true === this.Use_YLimit() && (Top > PRS.YLimit || Bottom2 > PRS.YLimit) && (CurLine != this.Pages[CurPage].FirstLine || false === bNoFootnotes || (0 === RealCurPage && (null != this.Get_DocumentPrev() || (true === this.Parent.Is_TableCellContent() && true !== this.Parent.Is_TableFirstRowOnNewPage())))) && false === BreakPageLineEmpty)
{
// TODO: Неразрывные абзацы и висячие строки внутри колонок вместе с плавающими объектами пока не обсчитываем
var bSkipWidowAndKeepLines = this.private_CheckSkipKeepLinesAndWidowControl(CurPage);
......
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