Commit 2a494c93 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Get_AllBoundsRectOnPageForMath

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64635 954022d7-b5bf-4e40-9824-e11837661b57
parent f30fdba6
......@@ -1132,6 +1132,11 @@ CDocument.prototype =
return this.clrSchemeMap;
},
Get_AllBoundsRectOnPageForMath: function(nPageIndex)
{
return this.DrawingObjects.getAllBoundsRectOnPageForMath(nPageIndex);
},
/**
* Данная функция предназначена для отключения пересчета. Это может быть полезно, т.к. редактор всегда запускает пересчет после каждого действия.
*
......
......@@ -104,6 +104,13 @@ CFlowTable.prototype =
},
Get_Distance : function()
{
var oDist = this.Distance;
return new CDistance(getValOrDefault(oDist.L, DISTANCE_TO_TEXT_LEFTRIGHT), getValOrDefault(oDist.T, 0), getValOrDefault(oDist.R, DISTANCE_TO_TEXT_LEFTRIGHT), getValOrDefault(oDist.B, 0));
},
getArrayWrapIntervals: function(x0,y0, x1, y1, Y0Sp, Y1Sp, LeftField, RightField, ret)
{
if(this.WrappingType === WRAPPING_TYPE_THROUGH || this.WrappingType === WRAPPING_TYPE_TIGHT)
......@@ -220,6 +227,13 @@ CFlowParagraph.prototype =
},
Get_Distance : function()
{
var oDist = this.Distance;
return new CDistance(getValOrDefault(oDist.L, DISTANCE_TO_TEXT_LEFTRIGHT), getValOrDefault(oDist.T, 0), getValOrDefault(oDist.R, DISTANCE_TO_TEXT_LEFTRIGHT), getValOrDefault(oDist.B, 0));
},
getArrayWrapIntervals: function(x0,y0, x1, y1, Y0Sp, Y1Sp, LeftField, RightField, ret)
{
return CFlowTable.prototype.getArrayWrapIntervals.call(this, x0,y0, x1, y1, Y0Sp, Y1Sp, LeftField, RightField, ret);
......
"use strict";
function CBoundsRectForMath(oDrawing)
{
this.L = 0;
this.T = 0;
this.R = 0;
this.B = 0;
if(oDrawing)
{
this.Distance = oDrawing.Get_Distance();
switch (oDrawing.Get_Type())
{
case para_Drawing:
{
switch(oDrawing.wrappingType)
{
case WRAPPING_TYPE_NONE:
{
break;
}
case WRAPPING_TYPE_SQUARE :
case WRAPPING_TYPE_THROUGH:
case WRAPPING_TYPE_TIGHT:
{
this.L = oDrawing.wrappingPolygon.left + this.Distance.L;
this.R = oDrawing.wrappingPolygon.right - this.Distance.R;
this.T = oDrawing.wrappingPolygon.top + this.Distance.T;
this.B = oDrawing.wrappingPolygon.bottom - this.Distance.B;
break;
}
case WRAPPING_TYPE_TOP_AND_BOTTOM:
{
var oLimits = editor.WordControl.m_oLogicDocument.Get_PageLimits(oDrawing.PageNum);
this.L = oLimits.X;
this.R = oLimits.XLimit;
this.T = oDrawing.wrappingPolygon.top + this.Distance.T;
this.B = oDrawing.wrappingPolygon.bottom - this.Distance.B;
break;
}
}
break;
}
case flowobject_Paragraph:
case flowobject_Table:
{
switch(oDrawing.WrappingType)
{
case WRAPPING_TYPE_NONE:
{
break;
}
case WRAPPING_TYPE_SQUARE :
case WRAPPING_TYPE_THROUGH:
case WRAPPING_TYPE_TIGHT:
{
this.L = oDrawing.X;
this.R = oDrawing.X + oDrawing.W;
this.T = oDrawing.Y;
this.B = oDrawing.Y + oDrawing.H;
break;
}
case WRAPPING_TYPE_TOP_AND_BOTTOM:
{
var oLimits = editor.WordControl.m_oLogicDocument.Get_PageLimits(oDrawing.PageNum);
this.L = oLimits.X;
this.R = oLimits.XLimit;
this.T = oDrawing.Y;
this.B = oDrawing.Y + oDrawing.H;
break;
}
}
}
}
}
else
{
this.Distance = new CDistance(0, 0, 0, 0);
}
}
function CGraphicObjects(document, drawingDocument, api)
{
this.api = api;
......@@ -164,6 +246,15 @@ CGraphicObjects.prototype =
getChartSpace2: DrawingObjectsController.prototype.getChartSpace2,
getAllBoundsRectOnPageForMath: function(nPageIndex)
{
if(this.graphicPages[nPageIndex])
{
return this.graphicPages[nPageIndex].getAllBoundsRectOnPageForMath();
}
return [];
},
clearPreTrackObjects: function()
{
......
......@@ -93,6 +93,23 @@ CGraphicPage.prototype =
}
},
getAllBoundsRectOnPageForMath: function()
{
var aRet = [], i;
for(i = 0; i < this.wrappingObjects.length; ++i)
{
if(this.wrappingObjects[i].parent)
{
aRet.push(new CBoundsRectForMath(this.wrappingObjects[i].parent));
}
}
for(i = 0; i < this.flowTables.length; ++i)
{
aRet.push(new CBoundsRectForMath(this.flowTables[i]));
}
return aRet;
},
concatPage: function(page)
{
this.inlineObjects = this.inlineObjects.concat(page.inlineObjects);
......
......@@ -192,7 +192,7 @@ CWrapPolygon.prototype =
getArrayWrapIntervals: function(x0, y0, x1, y1, LeftField, RightField, ret)
{
if(y1 < this.top || y0 > this.bottom)
if(y1 - this.top < 0.0001 || this.bottom - y0 < 0.0001)
return ret;
var ret2 = [];
......
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