Commit 5a2750c5 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Bug #31812 Исправлена проблема с pageBreak, идущем в параграфе с разрывом...

Bug #31812 Исправлена проблема с pageBreak, идущем в параграфе с разрывом секции на следующую страницу (получался двойной разрыв страницы).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@68648 954022d7-b5bf-4e40-9824-e11837661b57
parent 4a31d4c1
......@@ -2036,8 +2036,17 @@ CDocument.prototype =
if (null !== PrevElement && type_Paragraph === PrevElement.Get_Type() && Index !== Page.Pos)
{
var bNeedPageBreak = true;
if (undefined !== PrevElement.Get_SectionPr())
{
var PrevSectPr = PrevElement.Get_SectionPr();
var CurSectPr = this.LogicDocument.SectionsInfo.Get_SectPr(Index).SectPr;
if (section_type_Continuous !== CurSectPr.Get_Type() || true !== CurSectPr.Compare_PageSize(PrevSectPr))
bNeedPageBreak = false;
}
var EndLine = PrevElement.Pages[PrevElement.Pages.length - 1].EndLine;
if (-1 !== EndLine && PrevElement.Lines[EndLine].Info & paralineinfo_BreakRealPage)
if (true === bNeedPageBreak && -1 !== EndLine && PrevElement.Lines[EndLine].Info & paralineinfo_BreakRealPage)
isPageBreakOnPrevLine = true;
if (-1 !== EndLine && !(PrevElement.Lines[EndLine].Info & paralineinfo_BreakRealPage) && PrevElement.Lines[EndLine].Info & paralineinfo_BreakPage)
......
......@@ -2686,7 +2686,7 @@ ParaEnd.prototype =
var strSectionBreak = "";
switch ( Type )
{
case section_type_Column : strSectionBreak = " Section Break (Column) "; break;
case section_type_Column : strSectionBreak = " End of Section "; break;
case section_type_Continuous : strSectionBreak = " Section Break (Continuous) "; break;
case section_type_EvenPage : strSectionBreak = " Section Break (Even Page) "; break;
case section_type_NextPage : strSectionBreak = " Section Break (Next Page) "; break;
......
......@@ -766,9 +766,21 @@ Paragraph.prototype.private_RecalculatePageBreak = function(CurLine, CurPa
}
else if (null !== PrevElement && type_Paragraph === PrevElement.Get_Type())
{
var EndLine = PrevElement.Pages[PrevElement.Pages.length - 1].EndLine;
if (-1 !== EndLine && PrevElement.Lines[EndLine].Info & paralineinfo_BreakRealPage)
isPageBreakOnPrevLine = true;
var bNeedPageBreak = true;
if (type_Paragraph === PrevElement.GetType() && undefined !== PrevElement.Get_SectionPr())
{
var PrevSectPr = PrevElement.Get_SectionPr();
var CurSectPr = this.LogicDocument.SectionsInfo.Get_SectPr(this.Index).SectPr;
if (section_type_Continuous !== CurSectPr.Get_Type() || true !== CurSectPr.Compare_PageSize(PrevSectPr))
bNeedPageBreak = false;
}
if (true === bNeedPageBreak)
{
var EndLine = PrevElement.Pages[PrevElement.Pages.length - 1].EndLine;
if (-1 !== EndLine && PrevElement.Lines[EndLine].Info & paralineinfo_BreakRealPage)
isPageBreakOnPrevLine = true;
}
}
// ColumnBreak для случая CurPage > 0 не разбираем здесь, т.к. он срабатывает автоматически
......
......@@ -132,6 +132,9 @@ CTable.prototype.private_RecalculateCheckPageColumnBreak = function(CurPage)
if (true !== this.Is_Inline()) // Случай Flow разбирается в Document.js
return true;
if (!this.LogicDocument || this.Parent !== this.LogicDocument)
return true;
var isPageBreakOnPrevLine = false;
var isColumnBreakOnPrevLine = false;
......@@ -142,9 +145,21 @@ CTable.prototype.private_RecalculateCheckPageColumnBreak = function(CurPage)
if ((0 === CurPage || true === this.Check_EmptyPages(CurPage - 1)) && null !== PrevElement && type_Paragraph === PrevElement.Get_Type())
{
var EndLine = PrevElement.Pages[PrevElement.Pages.length - 1].EndLine;
if (-1 !== EndLine && PrevElement.Lines[EndLine].Info & paralineinfo_BreakRealPage)
isPageBreakOnPrevLine = true;
var bNeedPageBreak = true;
if (undefined !== PrevElement.Get_SectionPr())
{
var PrevSectPr = PrevElement.Get_SectionPr();
var CurSectPr = this.LogicDocument.SectionsInfo.Get_SectPr(this.Index).SectPr;
if (section_type_Continuous !== CurSectPr.Get_Type() || true !== CurSectPr.Compare_PageSize(PrevSectPr))
bNeedPageBreak = false;
}
if (true === bNeedPageBreak)
{
var EndLine = PrevElement.Pages[PrevElement.Pages.length - 1].EndLine;
if (-1 !== EndLine && PrevElement.Lines[EndLine].Info & paralineinfo_BreakRealPage)
isPageBreakOnPrevLine = true;
}
}
// ColumnBreak для случая CurPage > 0 не разбираем здесь, т.к. он срабатывает автоматически
......
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