Commit c0ea6faa authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bugs with determining a page index and refreshing itself a bounding path...

Fixed bugs with determining a page index and refreshing itself a bounding path for inline content control.
parent 2254f58f
...@@ -214,10 +214,11 @@ CInlineLevelSdt.prototype.Recalculate_Range_Spaces = function(PRSA, _CurLine, _C ...@@ -214,10 +214,11 @@ CInlineLevelSdt.prototype.Recalculate_Range_Spaces = function(PRSA, _CurLine, _C
W : X1 - X0, W : X1 - X0,
Y : Y0, Y : Y0,
H : Y1 - Y0, H : Y1 - Y0,
Page : PRSA.Paragraph.Get_AbsolutePage(_CurPage) Page : PRSA.Paragraph.Get_AbsolutePage(_CurPage),
PageInternal : _CurPage
}; };
this.BoundsPath = null; this.BoundsPaths = null;
}; };
CInlineLevelSdt.prototype.Get_LeftPos = function(SearchPos, ContentPos, Depth, UseContentPos) CInlineLevelSdt.prototype.Get_LeftPos = function(SearchPos, ContentPos, Depth, UseContentPos)
{ {
...@@ -328,16 +329,21 @@ CInlineLevelSdt.prototype.GetBoundingPolygon = function() ...@@ -328,16 +329,21 @@ CInlineLevelSdt.prototype.GetBoundingPolygon = function()
{ {
if (null === this.BoundsPaths) if (null === this.BoundsPaths)
{ {
var arrRects = []; var arrBounds = [], arrRects = [], CurPage = -1;
for (var Key in this.Bounds) for (var Key in this.Bounds)
{ {
if (CurPage !== this.Bounds[Key].PageInternal)
{
arrRects = [];
arrBounds.push(arrRects);
CurPage = this.Bounds[Key].PageInternal;
}
arrRects.push(this.Bounds[Key]); arrRects.push(this.Bounds[Key]);
} }
var oPolygon = new CPolygon(); var oPolygon = new CPolygon();
oPolygon.fill([arrRects]); oPolygon.fill(arrBounds);
this.BoundsPaths = oPolygon.GetPaths(0); this.BoundsPaths = oPolygon.GetPaths(0);
} }
...@@ -464,13 +470,6 @@ CInlineLevelSdt.prototype.Write_ToBinary = function(Writer) ...@@ -464,13 +470,6 @@ CInlineLevelSdt.prototype.Write_ToBinary = function(Writer)
Writer.WriteLong(this.Type); Writer.WriteLong(this.Type);
Writer.WriteString2(this.Id); Writer.WriteString2(this.Id);
}; };
//----------------------------------------------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------------------------------------------
CInlineLevelSdt.prototype.UpdatePath = function(CurPage, oPath)
{
this.BoundsPath[CurPage] = oPath;
};
//--------------------------------------------------------export-------------------------------------------------------- //--------------------------------------------------------export--------------------------------------------------------
window['AscCommonWord'] = window['AscCommonWord'] || {}; window['AscCommonWord'] = window['AscCommonWord'] || {};
window['AscCommonWord'].CInlineLevelSdt = CInlineLevelSdt; window['AscCommonWord'].CInlineLevelSdt = CInlineLevelSdt;
......
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