Commit 122ea221 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@55432 954022d7-b5bf-4e40-9824-e11837661b57
parent 37caa0c1
......@@ -1028,13 +1028,19 @@ ParaComment.prototype =
PRSI.Remove_Comment( this.CommentId );
},
Save_Lines : function()
Save_RecalculateObject : function(Copy)
{
var CommentLines = new CParagraphLinesInfo(this.StartLine, this.StartRange);
return CommentLines;
var RecalcObj = new CRunRecalculateObject(this.StartLine, this.StartRange);
return RecalcObj;
},
Restore_Lines : function(CommentLines)
Load_RecalculateObject : function(RecalcObj)
{
this.StartLine = RecalcObj.StartLine;
this.StartRange = RecalcObj.StartRange;
},
Prepare_RecalculateObject : function()
{
},
......
This diff is collapsed.
......@@ -837,6 +837,28 @@ CDocumentContent.prototype =
}
},
Save_RecalculateObject : function()
{
var RecalcObj = new CDocumentRecalculateObject();
RecalcObj.Save( this );
return RecalcObj;
},
Load_RecalculateObject : function(RecalcObj)
{
RecalcObj.Load( this );
},
Prepare_RecalculateObject : function()
{
this.Pages = [];
var Count = this.Content.length;
for ( var Index = 0; Index < Count; Index++ )
{
this.Content[Index].Prepare_RecalculateObject();
}
},
ReDraw : function(StartPage, EndPage)
{
if ( "undefined" === typeof(StartPage) )
......@@ -8589,3 +8611,39 @@ CDocumentContent.prototype =
}
};
function CDocumentRecalculateObject()
{
this.StartPage = 0;
this.Pages = [];
this.Content = [];
}
CDocumentRecalculateObject.prototype =
{
Save : function(Doc)
{
this.StartPage = Doc.StartPage;
this.Pages = Doc.Pages;
var Content = Doc.Content;
var Count = Content.length;
for ( var Index = 0; Index < Count; Index++ )
{
this.Content[Index] = Content[Index].Save_RecalculateObject();
}
},
Load : function(Doc)
{
Doc.StartPage = this.StartPage;
Doc.Pages = this.Pages;
var Count = Doc.Content.length;
for ( var Index = 0; Index < Count; Index++ )
{
Doc.Content[Index].Load_RecalculateObject( this.Content[Index] );
}
}
};
\ No newline at end of file
This diff is collapsed.
......@@ -91,6 +91,18 @@ ParaHyperlink.prototype =
return NewHyperlink;
},
Get_AllDrawingObjects : function(DrawingObjs)
{
var Count = this.Content.length;
for ( var Index = 0; Index < Count; Index++ )
{
var Item = this.Content[Index];
if ( para_Run === Item.Type || para_Hyperlink === Item.Type )
Item.Get_AllDrawingObjects(DrawingObjs);
}
},
Set_Paragraph : function(Paragraph)
{
......@@ -851,37 +863,32 @@ ParaHyperlink.prototype =
}
},
Save_Lines : function()
Save_RecalculateObject : function(Copy)
{
var HyperLines = new CParagraphLinesInfo(this.StartLine, this.StartRange);
for ( var CurLine = 0; CurLine < this.LinesLength; CurLine++ )
{
HyperLines.Lines.push( this.Lines[CurLine].Copy() );
}
HyperLines.LinesLength = this.LinesLength;
var ContentLen = this.Content.length;
for ( var CurPos = 0; CurPos < ContentLen; CurPos++ )
{
var ContentLines = this.Content[CurPos].Save_Lines();
HyperLines.Content.push( ContentLines );
}
var RecalcObj = new CRunRecalculateObject(this.StartLine, this.StartRange);
RecalcObj.Save_Lines( this, Copy );
RecalcObj.Save_Content( this, Copy );
return RecalcObj;
},
return HyperLines;
Load_RecalculateObject : function(RecalcObj)
{
RecalcObj.Load_Lines( this );
RecalcObj.Load_Content( this );
},
Restore_Lines : function(HyperLines)
Prepare_RecalculateObject : function()
{
this.Lines = HyperLines.Lines;
this.LinesLength = HyperLines.LinesLength;
this.Range = this.Lines[0].Ranges[0];
this.Lines = [];
this.Lines[0] = new CParaRunLine();
this.LinesLength = 0;
var ContentLen = this.Content.length;
for ( var CurPos = 0; CurPos < ContentLen; CurPos++ )
this.Range = this.Lines[0].Ranges[0];
var Count = this.Content.length;
for ( var Index = 0; Index < Count; Index++ )
{
this.Content[CurPos].Restore_Lines( HyperLines.Content[CurPos] );
this.Content[Index].Prepare_RecalculateObject();
}
},
......
......@@ -558,25 +558,29 @@ ParaMath.prototype =
{
},
Save_Lines : function()
Save_RecalculateObject : function(Copy)
{
var HyperLines = new CParagraphLinesInfo(this.StartLine, this.StartRange);
for ( var CurLine = 0; CurLine < this.LinesLength; CurLine++ )
{
HyperLines.Lines.push( this.Lines[CurLine].Copy() );
}
HyperLines.LinesLength = this.LinesLength;
var RecalcObj = new CRunRecalculateObject(this.StartLine, this.StartRange);
RecalcObj.Save_Lines( this, Copy );
// TODO: Сделать сохранение пересчета у формулы
return RecalcObj;
},
return HyperLines;
Load_RecalculateObject : function(RecalcObj)
{
RecalcObj.Load_Lines(this);
RecalcObj.Load_ZeroRange(this);
},
Restore_Lines : function(HyperLines)
Prepare_RecalculateObject : function()
{
this.Lines = HyperLines.Lines;
this.LinesLength = HyperLines.LinesLength;
this.Range = this.Lines[0].Ranges[0];
this.Lines = [];
this.Lines[0] = new CParaRunLine();
this.LinesLength = 0;
this.Range = this.Lines[0].Ranges[0];
},
Is_EmptyRange : function(_CurLine, _CurRange)
......@@ -837,7 +841,6 @@ ParaMath.prototype =
SearchPos.CurX = CurX + Dx;
return Result;
},
......
This diff is collapsed.
......@@ -4170,7 +4170,7 @@ ParaDrawing.prototype =
this.WidthVisible = this.W;
},
Save_RecalculateObject : function()
Save_RecalculateObject : function(Copy)
{
return null;
},
......@@ -7263,9 +7263,9 @@ ParaPageNum.prototype =
this.WidthVisible = RealWidth;
},
Save_RecalculateObject : function()
Save_RecalculateObject : function(Copy)
{
return new CPageNumRecalculateObject(this.Widths, this.String, this.Width);
return new CPageNumRecalculateObject(this.Widths, this.String, this.Width, Copy);
},
Load_RecalculateObject : function(RecalcObj)
......@@ -7319,11 +7319,20 @@ ParaPageNum.prototype =
}
};
function CPageNumRecalculateObject(Widths, String, Width)
function CPageNumRecalculateObject(Widths, String, Width, Copy)
{
this.Widths = Widths;
this.String = String;
this.Width = Width;
if ( true === Copy )
{
this.Widths = [];
var Len = Widths.length;
for ( var Index = 0; Index < Count; Index++ )
this.Widths[Index] = Widths[Index];
}
}
......
......@@ -120,6 +120,18 @@ ParaRun.prototype =
return NewRun;
},
Get_AllDrawingObjects : function(DrawingObjs)
{
var Count = this.Content.length;
for ( var Index = 0; Index < Count; Index++ )
{
var Item = this.Content[Index];
if ( para_Drawing === Item.Type )
DrawingObjs.push(Item);
}
},
Clear_ContentChanges : function()
{
this.m_oContentChanges.Clear();
......@@ -1484,6 +1496,9 @@ ParaRun.prototype =
}
case para_PageNum:
{
// Выставляем номер страницы
Item.Set_Page(PRS.Page + Para.Get_StartPage_Absolute());
// Если до этого было слово, тогда не надо проверять убирается ли оно, но если стояли пробелы,
// тогда мы их учитываем при проверке убирается ли данный элемент, и добавляем только если
// данный элемент убирается
......@@ -1521,7 +1536,7 @@ ParaRun.prototype =
}
SpaceLen = 0;
break;
}
case para_Tab:
......@@ -2302,25 +2317,40 @@ ParaRun.prototype =
this.Paragraph.Refresh_RecalcData2(0);
},
Save_Lines : function()
Save_RecalculateObject : function(Copy)
{
var RunLines = new CParagraphLinesInfo(this.StartLine, this.StartRange);
for ( var CurLine = 0; CurLine < this.LinesLength; CurLine++ )
{
RunLines.Lines.push( this.Lines[CurLine].Copy() );
}
RunLines.LinesLength = this.LinesLength;
var RecalcObj = new CRunRecalculateObject(this.StartLine, this.StartRange);
RecalcObj.Save_Lines( this );
RecalcObj.Save_RunContent( this );
// TODO: Разобраться с картинками
return RecalcObj;
},
return RunLines;
Load_RecalculateObject : function(RecalcObj)
{
RecalcObj.Load_Lines(this);
RecalcObj.Load_ZeroRange(this);
RecalcObj.Load_RunContent( this );
},
Restore_Lines : function(RunLines)
Prepare_RecalculateObject : function()
{
this.Lines = RunLines.Lines;
this.LinesLength = RunLines.LinesLength;
this.Range = this.Lines[0].Ranges[0];
this.Lines = [];
this.Lines[0] = new CParaRunLine();
this.LinesLength = 0;
this.Range = this.Lines[0].Ranges[0];
var Count = this.Content.length;
for ( var Index = 0; Index < Count; Index++ )
{
var Item = this.Content[Index];
if ( para_PageNum === Item.Type || para_Drawing === Item.Type )
Item.Prepare_RecalculateObject();
}
},
Is_EmptyRange : function(_CurLine, _CurRange)
......@@ -2615,7 +2645,7 @@ ParaRun.prototype =
}
}
}
},
},
//-----------------------------------------------------------------------------------
// Функции отрисовки
//-----------------------------------------------------------------------------------
......@@ -2810,13 +2840,7 @@ ParaRun.prototype =
{
bFirstLineItem = false;
if ( para_PageNum != Item.Type )
Item.Draw( X, Y - this.YOffset, pGraphics );
else
{
var ParaJc = Para.Get_CompiledPr2(false).ParaPr.Jc;
Item.Draw( X, Y - this.YOffset, pGraphics, Para.Get_StartPage_Absolute() + CurPage, ParaJc );
}
Item.Draw( X, Y - this.YOffset, pGraphics );
X += Item.WidthVisible;
}
......@@ -6479,7 +6503,6 @@ function CRunCollaborativeRange(PosS, PosE)
}
ParaRun.prototype.Math_SetPosition = function(_pos)
{
var pos = {x: _pos.x, y: _pos.y - this.size.ascent};
......
......@@ -74,6 +74,24 @@ CSectionPr.prototype =
this.Set_Borders_Display( Other.Borders.Display );
this.Set_Borders_OffsetFrom( Other.Borders.OffsetFrom );
this.Set_Borders_ZOrder( Other.Borders.ZOrder );
// Колонтитулы
this.Set_Header_First( Other.HeaderFirst );
this.Set_Header_Even( Other.HeaderEven );
this.Set_Header_Default( Other.HeaderDefault );
this.Set_Footer_First( Other.FooterFirst );
this.Set_Footer_Even( Other.FooterEven );
this.Set_Footer_Default( Other.FooterDefault );
},
Clear_AllHdrFtr : function()
{
this.Set_Header_First( null );
this.Set_Header_Even( null );
this.Set_Header_Default( null );
this.Set_Footer_First( null );
this.Set_Footer_Even( null );
this.Set_Footer_Default( null );
},
Compare_PageSize : function(OtherSectionPr)
......
......@@ -4430,6 +4430,22 @@ CTable.prototype =
}
}
},
Save_RecalculateObject : function()
{
var RecalcObj = new CTableRecalculateObject();
RecalObj.Save( this );
return RecalcObj;
},
Load_RecalculateObject : function(RecalcObj)
{
RecalcObj.Load(this);
},
Prepare_RecalculateObject : function()
{
},
Get_LastRangeVisibleBounds : function()
{
......@@ -21827,4 +21843,20 @@ CTableCell.prototype =
if ( "undefined" != typeof(LinkData.Row) )
this.Row = g_oTableId.Get_ById( LinkData.Row );
}
};
function CTableRecalculateObject()
{
}
CTableRecalculateObject.prototype =
{
Save : function()
{
},
Load : function()
{
}
};
\ No newline at end of file
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