Commit d21486c6 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@68446 954022d7-b5bf-4e40-9824-e11837661b57
parent 4e2d72c4
......@@ -1435,6 +1435,31 @@ CDocument.prototype =
return { X : X, Y : Y, XLimit : XLimit, YLimit : YLimit };
},
Get_ColumnFields : function(ElementIndex, ColumnIndex)
{
var SectPr = this.SectionsInfo.Get_SectPr(ElementIndex).SectPr;
var Y = SectPr.Get_PageMargin_Top();
var YLimit = SectPr.Get_PageHeight() - SectPr.Get_PageMargin_Bottom();
var X = SectPr.Get_PageMargin_Left();
var XLimit = SectPr.Get_PageWidth() - SectPr.Get_PageMargin_Right();
var ColumnsCount = SectPr.Get_ColumnsCount();
if (ColumnIndex >= ColumnsCount)
ColumnIndex = ColumnsCount - 1;
for (var ColIndex = 0; ColIndex < ColumnIndex; ++ColIndex)
{
X += SectPr.Get_ColumnWidth(ColIndex);
X += SectPr.Get_ColumnSpace(ColIndex);
}
if (ColumnsCount - 1 !== ColumnIndex)
XLimit = X + SectPr.Get_ColumnWidth(ColumnIndex);
return {X: X, XLimit: XLimit};
},
Get_Theme : function()
{
return this.theme;
......@@ -3131,6 +3156,9 @@ CDocument.prototype =
var ColumnStartPos = Column.Pos;
var ColumnEndPos = Column.EndPos;
// Плавающие объекты не должны попадать в клип колонок
var FlowElements = [];
if (ColumnsCount > 1)
{
pGraphics.SaveGrState();
......@@ -3141,15 +3169,29 @@ CDocument.prototype =
}
for (var ContentPos = ColumnStartPos; ContentPos <= ColumnEndPos; ++ContentPos)
{
if (true === this.Content[ContentPos].Is_Inline())
{
var ElementPageIndex = this.private_GetElementPageIndex(ContentPos, nPageIndex, ColumnIndex, ColumnsCount);
this.Content[ContentPos].Draw(ElementPageIndex, pGraphics);
}
else
{
FlowElements.push(ContentPos);
}
}
if (ColumnsCount > 1)
{
pGraphics.RestoreGrState();
}
for (var FlowPos = 0, FlowsCount = FlowElements.length; FlowPos < FlowsCount; ++FlowPos)
{
var ContentPos = FlowElements[FlowPos];
var ElementPageIndex = this.private_GetElementPageIndex(ContentPos, nPageIndex, ColumnIndex, ColumnsCount);
this.Content[ContentPos].Draw(ElementPageIndex, pGraphics);
}
}
}
......
......@@ -142,6 +142,12 @@ CFlowTable.prototype =
}
case WRAPPING_TYPE_TOP_AND_BOTTOM:
{
var L = this.X - getValOrDefault(this.Distance.L, DISTANCE_TO_TEXT_LEFTRIGHT);
var R = this.X + this.W + getValOrDefault(this.Distance.R, DISTANCE_TO_TEXT_LEFTRIGHT);
if (R < LeftField || L > RightField)
return ret;
X0 = x0;
X1 = x1;
Y1 = bottom;
......
......@@ -1346,7 +1346,7 @@ Paragraph.prototype.private_RecalculateLineCheckRanges = function(CurLine, CurPa
else
Left = false === PRS.UseFirstLine ? this.Pages[CurPage].X + ParaPr.Ind.Left : this.Pages[CurPage].X + ParaPr.Ind.Left + ParaPr.Ind.FirstLine;
var PageFields = this.Parent.Get_PageFields(this.private_GetRelativePageIndex(CurPage));
var PageFields = this.Parent.Get_ColumnFields ? this.Parent.Get_ColumnFields(this.Get_Index(), this.Get_AbsoluteColumn(CurPage)) : this.Parent.Get_PageFields(this.private_GetRelativePageIndex(CurPage));
var Ranges = PRS.Ranges;
var Ranges2;
......
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