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

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49075 954022d7-b5bf-4e40-9824-e11837661b57
parent 4b3d0428
......@@ -1026,6 +1026,7 @@ CDocument.prototype =
{
var TempElement = this.Content[TempIndex];
TempElement.Shift( 0, FrameX, FrameY );
TempElement.Set_CalculatedFrame( FrameX, FrameY, FrameW, FrameH );
}
var FrameDx = ( undefined === FramePr.HSpace ? 0 : FramePr.HSpace );
......@@ -9281,7 +9282,43 @@ CDocument.prototype =
if ( this.Selection.StartPos == this.Selection.EndPos && type_Table === this.Content[this.Selection.StartPos].GetType() )
this.Content[this.Selection.StartPos].Document_UpdateRulersState(this.CurPage);
else
this.DrawingDocument.Set_RulerState_Paragraph( null );
{
var StartPos = ( this.Selection.EndPos <= this.Selection.StartPos ? this.Selection.EndPos : this.Selection.StartPos );
var EndPos = ( this.Selection.EndPos <= this.Selection.StartPos ? this.Selection.StartPos : this.Selection.EndPos );
var FramePr = undefined;
for ( var Pos = StartPos; Pos <= EndPos; Pos++ )
{
var Element = this.Content[Pos];
if ( type_Paragraph != Element.GetType() )
{
FramePr = undefined;
break;
}
else
{
var TempFramePr = Element.Get_FramePr();
if ( undefined === FramePr )
{
if ( undefined === TempFramePr )
break;
FramePr = TempFramePr;
}
else if ( false === FramePr.Compare(TempFramePr) )
{
FramePr = undefined;
break;
}
}
}
if ( undefined === FramePr )
this.DrawingDocument.Set_RulerState_Paragraph( null );
else
this.Content[StartPos].Document_UpdateRulersState();
}
}
else
{
......@@ -9291,7 +9328,7 @@ CDocument.prototype =
if ( type_Table === Item.GetType() )
Item.Document_UpdateRulersState(this.CurPage);
else
this.DrawingDocument.Set_RulerState_Paragraph( null );
Item.Document_UpdateRulersState();
}
}
},
......
......@@ -34,6 +34,15 @@ function Paragraph(DrawingDocument, Parent, PageNum, X, Y, XLimit, YLimit)
};
this.Pr = new CParaPr();
// Рассчитанное положение рамки
this.CalculatedFrame =
{
L : 0,
T : 0,
W : 0,
H : 0
};
// Данный TextPr будет относится только к символу конца параграфа
this.TextPr = new ParaTextPr();
this.TextPr.Parent = this;
......@@ -10250,6 +10259,19 @@ Paragraph.prototype =
}
},
// Обновляем линейку
Document_UpdateRulersState : function()
{
var FramePr = this.Get_FramePr();
if ( undefined === FramePr )
this.Parent.DrawingDocument.Set_RulerState_Paragraph( null );
else
{
var Frame = this.CalculatedFrame;
this.Parent.DrawingDocument.Set_RulerState_Paragraph( { L : Frame.L, T : Frame.T, R : Frame.L + Frame.W, B : Frame.T + Frame.H, Frame : true } );
}
},
// Пока мы здесь проверяем только, находимся ли мы внутри гиперссылки
Document_UpdateInterfaceState : function()
{
......@@ -10457,6 +10479,14 @@ Paragraph.prototype =
this.CompiledPr.NeedRecalc = true;
},
Set_CalculatedFrame : function(L, T, W, H)
{
this.CalculatedFrame.T = T;
this.CalculatedFrame.L = L;
this.CalculatedFrame.W = W;
this.CalculatedFrame.H = H;
},
// Разделяем данный параграф
Split : function(NewParagraph, Pos)
{
......
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