Commit 756c17c5 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55788 954022d7-b5bf-4e40-9824-e11837661b57
parent 3d61070c
......@@ -98,6 +98,59 @@ CFlowTable.prototype =
Update_CursorType : function(X, Y, PageIndex)
{
},
getArrayWrapIntervals: function(x0,y0, x1, y1, Y0Sp, Y1Sp, LeftField, RightField, ret)
{
if(this.WrappingType === WRAPPING_TYPE_THROUGH || this.WrappingType === WRAPPING_TYPE_TIGHT)
{
y0 = Y0Sp;
y1 = Y1Sp;
}
var top = this.Y - this.Distance.T;
var bottom = this.Y + this.H + this.Distance.B;
if(y1 < top || y0 > bottom)
return ret;
var b_check = false, X0, X1, Y1;
switch(this.WrappingType)
{
case WRAPPING_TYPE_NONE:
{
return ret;
}
case WRAPPING_TYPE_SQUARE:
case WRAPPING_TYPE_THROUGH:
case WRAPPING_TYPE_TIGHT:
{
X0 = this.X - this.Distance.L;
X1 = this.X + this.W + this.Distance.R;
Y1 = bottom;
b_check = true;
break;
}
case WRAPPING_TYPE_TOP_AND_BOTTOM:
{
X0 = x0;
X1 = x1;
Y1 = bottom;
break;
}
}
if(b_check)
{
var dx = this.WrappingType === WRAPPING_TYPE_SQUARE ? 6.35 : 3.175 ;
if(X0 < LeftField + dx)
{
X0 = x0 ;
}
if(X1 > RightField - dx)
{
X1 = x1;
}
}
ret.push({X0: X0, X1: X1, Y1: Y1, typeLeft: this.WrappingType, typeRight: this.WrappingType});
return ret;
}
};
......
......@@ -3434,169 +3434,6 @@ function ComparisonByZIndex(obj1, obj2)
return array_type1 - array_type2;
}
function HeaderFooterGraphicObjects()
{
this.behindDocArray = [];
this.wrappingArray = [];
this.inlineArray = [];
this.beforeTextArray = [];
this.floatTables = [];
this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add( this, this.Id );
}
HeaderFooterGraphicObjects.prototype =
{
Get_Id: function()
{
return this.Id;
},
addHeader: function()
{
this.bHeader = true;
History.Add(this, {Type:historyitem_AddHdr});
},
addFooter: function()
{
this.bFooter = true;
History.Add(this, {Type:historyitem_AddFtr});
},
removeHeader: function()
{
this.bHeader = false;
History.Add(this, {Type:historyitem_RemoveHdr});
},
removeFooter: function()
{
this.bFooter = false;
History.Add(this, {Type:historyitem_RemoveFtr});
},
Write_ToBinary2: function(w)
{
w.WriteLong(historyitem_type_HdrFtrGrObjects);
w.WriteString2(this.Id);
},
Read_FromBinary2: function(r)
{
this.Id = r.GetString2();
g_oTableId.Add( this, this.Id );
},
Refresh_RecalcData: function()
{},
Undo: function(data)
{
switch(data.Type)
{
case historyitem_AddHdr:
{
this.bHeader = false;
break;
}
case historyitem_AddFtr:
{
this.bFooter = false;
break;
}
case historyitem_RemoveHdr:
{
this.bHeader = true;
break;
}
case historyitem_RemoveFtr:
{
this.bFooter = true;
break;
}
}
},
Redo: function(data)
{
switch(data.Type)
{
case historyitem_AddHdr:
{
this.bHeader = true;
break;
}
case historyitem_AddFtr:
{
this.bFooter = true;
break;
}
case historyitem_RemoveHdr:
{
this.bHeader = false;
break;
}
case historyitem_RemoveFtr:
{
this.bFooter = false;
break;
}
}
},
Save_Changes: function(data, w)
{
w.WriteLong(historyitem_type_HdrFtrGrObjects);
w.WriteLong(data.Type);
},
Load_Changes: function(r)
{
if(r.GetLong() !== historyitem_type_HdrFtrGrObjects)
return;
switch(r.GetLong())
{
case historyitem_AddHdr:
{
this.bHeader = true;
break;
}
case historyitem_AddFtr:
{
this.bFooter = true;
break;
}
case historyitem_RemoveHdr:
{
this.bHeader = false;
break;
}
case historyitem_RemoveFtr:
{
this.bFooter = false;
break;
}
}
}
};
function CreateImageFromBinary(bin, nW, nH)
{
var w, h;
......
......@@ -914,10 +914,7 @@ CWrapManager.prototype =
var arrFlowTables = this.graphicPage.flowTables;
for(index = 0; index < arrFlowTables.length; ++index)
{
var cur_float_table = arrFlowTables[index];
if(y1 < cur_float_table.Y - cur_float_table.Distance.T|| y0 > cur_float_table.Y + cur_float_table.H + cur_float_table.Distance.B)
continue;
arr_intervals.push({X0: cur_float_table.X - cur_float_table.Distance.L, X1: cur_float_table.X + cur_float_table.W + cur_float_table.Distance.R, Y1: cur_float_table.Y + cur_float_table.H + cur_float_table.Distance.B });
arrFlowTables[index].getArrayWrapIntervals(x0,y0, x1, y1, Y0sp, Y1Ssp, LeftField, RightField, arr_intervals);
}
}
else
......@@ -931,16 +928,13 @@ CWrapManager.prototype =
arrGraphicObjects[index].getArrayWrapIntervals(x0,y0, x1, y1, Y0sp, Y1Ssp, LeftField, RightField, arr_intervals);
}
}
arrFlowTables = this.graphicPage.flowTables;
for(index = 0; index < arrFlowTables.length; ++index)
{
cur_float_table = arrFlowTables[index];
var cur_float_table = arrFlowTables[index];
if(cur_float_table.Table.Parent === docContent)
{
if(y1 < cur_float_table.Y - cur_float_table.Distance.T|| y0 > cur_float_table.Y + cur_float_table.H + cur_float_table.Distance.B)
continue;
arr_intervals.push({X0: cur_float_table.X - cur_float_table.Distance.L, X1: cur_float_table.X + cur_float_table.W + cur_float_table.Distance.R, Y1: cur_float_table.Y + cur_float_table.H + cur_float_table.Distance.B });
cur_float_table.getArrayWrapIntervals(x0,y0, x1, y1, Y0sp, Y1Ssp, LeftField, RightField, arr_intervals);
}
}
}
......@@ -962,16 +956,13 @@ CWrapManager.prototype =
arrFlowTables = hdr_footer_objects.flowTables;
for(index = 0; index < arrFlowTables.length; ++index)
{
cur_float_table = arrFlowTables[index];
var cur_float_table = arrFlowTables[index];
if(cur_float_table.Table.Parent === docContent)
{
if(y1 < cur_float_table.Y - cur_float_table.Distance.T|| y0 > cur_float_table.Y + cur_float_table.H + cur_float_table.Distance.B)
continue;
arr_intervals.push({X0: cur_float_table.X - cur_float_table.Distance.L, X1: cur_float_table.X + cur_float_table.W + cur_float_table.Distance.R, Y1: cur_float_table.Y + cur_float_table.H + cur_float_table.Distance.B });
cur_float_table.getArrayWrapIntervals(x0,y0, x1, y1, Y0sp, Y1Ssp, LeftField, RightField, arr_intervals);
}
}
}
}
}
......
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