Commit 0451f5ab authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Исправлен баг с переносом буквицы на предыдущую страницу (баг 20412).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50224 954022d7-b5bf-4e40-9824-e11837661b57
parent 98e30e5e
......@@ -232,6 +232,8 @@ function CDocumentRecalcInfo()
this.WidowControlReset = false; //
this.KeepNextParagraph = null; // Параграф, который надо пересчитать из-за того, что следующий начался с новой страницы
this.FrameRecalc = false; // Пересчитываем ли рамку
}
CDocumentRecalcInfo.prototype =
......@@ -314,6 +316,12 @@ CDocumentRecalcInfo.prototype =
Reset_WidowControl : function()
{
this.WidowControlReset = true;
},
Set_FrameRecalc : function(Value)
{
this.FrameRecalc = Value;
}
};
......@@ -940,12 +948,16 @@ CDocument.prototype =
if ( undefined === Frame_YLimit )
Frame_YLimit = Page_Height;
for ( var TempIndex = Index; TempIndex < Index + FlowCount; TempIndex++ )
{
var TempElement = this.Content[TempIndex];
// Получим параметры расположения рамки
TempElement.Set_DocumentIndex( TempIndex );
TempElement.Reset( 0, FrameH, Frame_XLimit, Frame_YLimit, PageIndex );
if ( Index != TempIndex || true != this.RecalcInfo.FrameRecalc )
TempElement.Reset( 0, FrameH, Frame_XLimit, Frame_YLimit, PageIndex );
TempElement.Recalculate_Page( PageIndex );
FrameH = TempElement.Get_PageBounds( PageIndex - TempElement.Get_StartPage_Absolute()).Bottom;
......@@ -1105,26 +1117,36 @@ CDocument.prototype =
var FrameBounds = this.Content[Index].Get_FrameBounds(FrameX, FrameY, FrameW, FrameH);
var FrameX2 = FrameBounds.X, FrameY2 = FrameBounds.Y, FrameW2 = FrameBounds.W, FrameH2 = FrameBounds.H;
for ( var TempIndex = Index; TempIndex < Index + FlowCount; TempIndex++ )
if ( (FrameY2 + FrameH2 > YLimit || Y > YLimit - 0.001 ) && Index != StartIndex )
{
var TempElement = this.Content[TempIndex];
TempElement.Shift( 0, FrameX, FrameY );
TempElement.Set_CalculatedFrame( FrameX, FrameY, FrameW, FrameH, FrameX2, FrameY2, FrameW2, FrameH2, PageIndex );
this.RecalcInfo.Set_FrameRecalc(true);
this.Content[Index].Start_FromNewPage();
RecalcResult = recalcresult_NextPage;
}
else
{
this.RecalcInfo.Set_FrameRecalc(false);
for ( var TempIndex = Index; TempIndex < Index + FlowCount; TempIndex++ )
{
var TempElement = this.Content[TempIndex];
TempElement.Shift( TempElement.Pages.length - 1, FrameX, FrameY );
TempElement.Set_CalculatedFrame( FrameX, FrameY, FrameW, FrameH, FrameX2, FrameY2, FrameW2, FrameH2, PageIndex );
}
var FrameDx = ( undefined === FramePr.HSpace ? 0 : FramePr.HSpace );
var FrameDy = ( undefined === FramePr.VSpace ? 0 : FramePr.VSpace );
var FrameDx = ( undefined === FramePr.HSpace ? 0 : FramePr.HSpace );
var FrameDy = ( undefined === FramePr.VSpace ? 0 : FramePr.VSpace );
this.DrawingObjects.addFloatTable( new CFlowParagraph( Element, FrameX2, FrameY2, FrameW2, FrameH2, FrameDx, FrameDy, Index, FlowCount ) );
this.DrawingObjects.addFloatTable( new CFlowParagraph( Element, FrameX2, FrameY2, FrameW2, FrameH2, FrameDx, FrameDy, Index, FlowCount ) );
Index += FlowCount - 1;
Index += FlowCount - 1;
if ( FrameY >= Y )
RecalcResult = recalcresult_NextElement;
else
{
this.RecalcInfo.Set_FlowObject(Element, FlowCount, recalcresult_NextElement);
RecalcResult = recalcresult_CurPage;
if ( FrameY >= Y )
RecalcResult = recalcresult_NextElement;
else
{
this.RecalcInfo.Set_FlowObject(Element, FlowCount, recalcresult_NextElement);
RecalcResult = recalcresult_CurPage;
}
}
}
else if ( true === this.RecalcInfo.Check_FlowObject(Element) )
......
......@@ -2290,7 +2290,7 @@ function CFlowParagraph(Paragraph, X, Y, W, H, Dx, Dy, StartIndex, FlowCount)
this.Paragraph = Paragraph;
this.Id = Paragraph.Get_Id();
this.PageNum = Paragraph.PageNum;
this.PageNum = Paragraph.PageNum + Paragraph.Pages.length - 1;
this.PageController = 0;
this.StartIndex = StartIndex;
......
......@@ -916,7 +916,7 @@ Paragraph.prototype =
// Смещаемся в начало параграфа на первой странице или в начало страницы, если страница не первая
var X, Y, XLimit, YLimit, _X, _XLimit;
if ( 0 === CurPage )
if ( 0 === CurPage || undefined != this.Get_FramePr() )
{
X = this.X + ParaPr.Ind.Left + ParaPr.Ind.FirstLine;
Y = this.Y;
......@@ -1889,16 +1889,6 @@ Paragraph.prototype =
Item.WidthVisible = NewX - X;
X = NewX;
//this.Lines[CurLine].Words++;
//this.Lines[CurLine].Ranges[CurRange].Words++;
// Пробелы перед первым словом в строке не считаем
//if ( this.Lines[CurLine].Words > 1 )
// this.Lines[CurLine].Spaces += nSpacesCount;
//if ( this.Lines[CurLine].Ranges[CurRange].Words > 1 )
// this.Lines[CurLine].Ranges[CurRange].Spaces += nSpacesCount;
}
}
......
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