Commit 0d087526 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Разобран случай, когда перед рамкой или таблицей идет разрыв страницы или колноки.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@67911 954022d7-b5bf-4e40-9824-e11837661b57
parent a5bb023e
......@@ -1963,30 +1963,56 @@ CDocument.prototype =
{
bFlow = true;
var RecalcInfo =
{
Element : Element,
X : X,
Y : Y,
XLimit : XLimit,
YLimit : YLimit,
PageIndex : PageIndex,
SectionIndex : SectionIndex,
ColumnIndex : ColumnIndex,
Index : Index,
StartIndex : StartIndex,
ColumnsCount : ColumnsCount,
ResetStartElement : bResetStartElement,
RecalcResult : RecalcResult
};
// Проверяем PageBreak и ColumnBreak в предыдущей строке
var isPageBreakOnPrevLine = false;
var isColumnBreakOnPrevLine = false;
if (type_Table === Element.GetType())
this.private_RecalculateFlowTable(RecalcInfo)
else if (type_Paragraph === Element.Get_Type())
this.private_RecalculateFlowParagraph(RecalcInfo);
var PrevElement = Element.Get_DocumentPrev();
if (null !== PrevElement && type_Paragraph === PrevElement.Get_Type() && Index !== StartIndex)
{
var EndLine = PrevElement.Pages[PrevElement.Pages.length - 1].EndLine;
if (-1 !== EndLine && PrevElement.Lines[EndLine].Info & paralineinfo_BreakRealPage)
isPageBreakOnPrevLine = true;
Index = RecalcInfo.Index;
RecalcResult = RecalcInfo.RecalcResult;
if (-1 !== EndLine && !(PrevElement.Lines[EndLine].Info & paralineinfo_BreakRealPage) && PrevElement.Lines[EndLine].Info & paralineinfo_BreakPage)
isColumnBreakOnPrevLine = true;
}
if (true === isColumnBreakOnPrevLine)
{
RecalcResult = recalcresult_NextPage | recalcresultflags_LastFromNewColumn;
}
else if (true === isPageBreakOnPrevLine)
{
RecalcResult = recalcresult_NextPage | recalcresultflags_LastFromNewPage;
}
else
{
var RecalcInfo =
{
Element : Element,
X : X,
Y : Y,
XLimit : XLimit,
YLimit : YLimit,
PageIndex : PageIndex,
SectionIndex : SectionIndex,
ColumnIndex : ColumnIndex,
Index : Index,
StartIndex : StartIndex,
ColumnsCount : ColumnsCount,
ResetStartElement : bResetStartElement,
RecalcResult : RecalcResult
};
if (type_Table === Element.GetType())
this.private_RecalculateFlowTable(RecalcInfo)
else if (type_Paragraph === Element.Get_Type())
this.private_RecalculateFlowParagraph(RecalcInfo);
Index = RecalcInfo.Index;
RecalcResult = RecalcInfo.RecalcResult;
}
}
else
{
......
......@@ -739,7 +739,7 @@ Paragraph.prototype.private_RecalculatePageBreak = function(CurLine, CurPa
PRS.RecalcResult = recalcresult_NextPage;
return false;
}
else
else if (true === this.Is_Inline()) // Случай Flow разбирается в Document.js
{
// Проверяем PageBreak и ColumnBreak в предыдущей строке
var isPageBreakOnPrevLine = false;
......@@ -782,16 +782,16 @@ Paragraph.prototype.private_RecalculatePageBreak = function(CurLine, CurPa
}
}
// Эта проверка на случай, если предыдущий параграф закончился PageBreak
if (PRS.YStart > PRS.YLimit - 0.001 && (CurLine != this.Pages[CurPage].FirstLine || (0 === CurPage && (null != this.Get_DocumentPrev() || true === this.Parent.Is_TableCellContent()))) && true === this.Use_YLimit())
{
this.Pages[CurPage].Set_EndLine(CurLine - 1);
if ( 0 === CurLine )
this.Lines[-1] = new CParaLine( 0 );
PRS.RecalcResult = recalcresult_NextPage;
return false;
}
//// Эта проверка на случай, если предыдущий параграф закончился PageBreak
//if (PRS.YStart > PRS.YLimit - 0.001 && (CurLine != this.Pages[CurPage].FirstLine || (0 === CurPage && (null != this.Get_DocumentPrev() || true === this.Parent.Is_TableCellContent()))) && true === this.Use_YLimit())
//{
// this.Pages[CurPage].Set_EndLine(CurLine - 1);
// if ( 0 === CurLine )
// this.Lines[-1] = new CParaLine( 0 );
//
// PRS.RecalcResult = recalcresult_NextPage;
// return false;
//}
return true;
};
......
......@@ -134,6 +134,9 @@ CTable.prototype.Start_FromNewPage = function()
//----------------------------------------------------------------------------------------------------------------------
CTable.prototype.private_RecalculateCheckPageColumnBreak = function(CurPage)
{
if (true !== this.Is_Inline()) // Случай Flow разбирается в Document.js
return true;
var isPageBreakOnPrevLine = false;
var isColumnBreakOnPrevLine = false;
......
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