Commit e742a027 authored by Ilya.Kirillov's avatar Ilya.Kirillov

Сделан нормальный клип колонок. Исправлен баг с пересчетом параграфа...

Сделан нормальный клип колонок. Исправлен баг с пересчетом параграфа разбивающегося на 2 страницы, если есть колонки. Исправлен баг с табами.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@68293 954022d7-b5bf-4e40-9824-e11837661b57
parent 3a090fac
......@@ -356,6 +356,9 @@ function CDocumentPageColumn()
this.Y = 0;
this.XLimit = 0;
this.YLimit = 0;
this.SpaceBefore = 0;
this.SpaceAfter = 0;
}
CDocumentPageColumn.prototype.Copy = function()
{
......@@ -1376,7 +1379,10 @@ CDocument.prototype =
if (null !== YFooter && YFooter < YLimit)
YLimit = YFooter;
return {X: X, Y: Y, XLimit: XLimit, YLimit: YLimit};
var ColumnSpaceBefore = (ColumnAbs > 0 ? SectPr.Get_ColumnSpace(ColumnAbs - 1) : 0);
var ColumnSpaceAfter = (ColumnAbs < ColumnsCount - 1 ? SectPr.Get_ColumnSpace(ColumnAbs) : 0);
return {X: X, Y: Y, XLimit: XLimit, YLimit: YLimit, ColumnSpaceBefore : ColumnSpaceBefore, ColumnSpaceAfter : ColumnSpaceAfter};
},
Get_PageLimits : function(PageIndex)
......@@ -1930,12 +1936,14 @@ CDocument.prototype =
var PageSection = Page.Sections[SectionIndex];
var PageColumn = PageSection.Columns[ColumnIndex];
PageColumn.X = X;
PageColumn.XLimit = XLimit;
PageColumn.Y = Y;
PageColumn.YLimit = YLimit;
PageColumn.Pos = StartIndex;
PageColumn.Empty = false;
PageColumn.X = X;
PageColumn.XLimit = XLimit;
PageColumn.Y = Y;
PageColumn.YLimit = YLimit;
PageColumn.Pos = StartIndex;
PageColumn.Empty = false;
PageColumn.SpaceBefore = StartPos.ColumnSpaceBefore;
PageColumn.SpaceAfter = StartPos.ColumnSpaceAfter;
var SectElement = this.SectionsInfo.Get_SectPr(StartIndex);
var SectPr = SectElement.SectPr;
......@@ -3095,11 +3103,25 @@ CDocument.prototype =
var ColumnStartPos = Column.Pos;
var ColumnEndPos = Column.EndPos;
if (ColumnsCount > 1)
{
pGraphics.SaveGrState();
var X = ColumnIndex === 0 ? 0 : Column.X - Column.SpaceBefore / 2;
var XEnd = (ColumnIndex >= ColumnsCount - 1 ? Page.Width : Column.XLimit + Column.SpaceAfter / 2);
pGraphics.AddClipRect(X, 0, XEnd - X, Page.Height);
}
for (var ContentPos = ColumnStartPos; ContentPos <= ColumnEndPos; ++ContentPos)
{
var ElementPageIndex = this.private_GetElementPageIndex(ContentPos, nPageIndex, ColumnIndex, ColumnsCount);
this.Content[ContentPos].Draw(ElementPageIndex, pGraphics);
}
if (ColumnsCount > 1)
{
pGraphics.RestoreGrState();
}
}
}
......
......@@ -1268,7 +1268,7 @@ Paragraph.prototype.private_RecalculateLineBottomBound = function(CurLine, CurPa
// Сначала проверяем не нужно ли сделать перенос страницы в данном месте
// Перенос не делаем, если это первая строка на новой странице
if (true === this.Use_YLimit() && (Top > this.YLimit || Bottom2 > this.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 || (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);
......@@ -1914,7 +1914,7 @@ Paragraph.prototype.private_RecalculateGetTabPos = function(X, ParaPr, CurPage)
NewX = Tab.Pos + PageStart.X + 0.001;
}
return { NewX : NewX, TabValue : ( null === Tab ? tab_Left : Tab.Value ) };
return { NewX : NewX, TabValue : ( null === Tab ? tab_Left : Tab.Value ), DefaultTab : (null === Tab ? true : false) };
};
Paragraph.prototype.private_CheckSkipKeepLinesAndWidowControl = function(CurPage)
......
......@@ -2859,7 +2859,7 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
}
else
{
if (NewX > XEnd - 0.001 && XEnd < 558.7 && PRS.Range >= PRS.RangesCount - 1)
if (true !== TabPos.DefaultTab && NewX > XEnd - 0.001 && XEnd < 558.7 && PRS.Range >= PRS.RangesCount - 1)
{
Para.Lines[PRS.Line].Ranges[PRS.Range].XEnd = 558.7;
XEnd = 558.7;
......
......@@ -37,10 +37,6 @@ CTable.prototype.Draw = function(CurPage, pGraphics)
pGraphics.SaveGrState();
// TODO: Переделать обрезку
if (true === this.Is_Inline())
pGraphics.AddClipRect(Page.X - 15, Page.Y - 1, Page.XLimit + 30 - Page.X, Page.YLimit - Page.Y + 1);
var bIsSmartGrForcing = false;
if (pGraphics.StartCheckTableDraw)
bIsSmartGrForcing = pGraphics.StartCheckTableDraw();
......
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