Commit dc6daa2c authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug with drawing the bounding path around an inline content control in...

Fixed bug with drawing the bounding path around an inline content control in the header/footer. Fixed bug with not laying paragraph end mark inside bounds of the block level content control.
parent c9134dc1
......@@ -694,8 +694,7 @@ CInlineLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType)
var nContentControlLock = this.GetContentControlLock();
if (CheckContentControlLock
&& (AscCommon.changestype_Paragraph_Content === CheckType
if ((AscCommon.changestype_Paragraph_Content === CheckType
|| AscCommon.changestype_Remove === CheckType
|| AscCommon.changestype_Delete === CheckType
|| AscCommon.changestype_Document_Content === CheckType
......
......@@ -436,8 +436,8 @@ Paragraph.prototype.GetContentBounds = function(CurPage)
if (null === Left || Left > oRange.XVisible)
Left = oRange.XVisible;
if (null === Right || Right < oRange.XVisible + oRange.W)
Right = oRange.XVisible + oRange.W;
if (null === Right || Right < oRange.XVisible + oRange.W + oRange.WEnd)
Right = oRange.XVisible + oRange.W + oRange.WEnd;
}
......
......@@ -1674,7 +1674,8 @@ Paragraph.prototype.private_RecalculateLineAlign = function(CurLine, CurPa
PRSC.Reset( this, Range );
PRSC.Range.W = 0;
PRSC.Range.W = 0;
PRSC.Range.WEnd = 0;
if ( true === this.Numbering.Check_Range(CurRange, CurLine) )
PRSC.Range.W += this.Numbering.WidthVisible;
......@@ -2453,6 +2454,7 @@ function CParaLineRange(X, XEnd)
this.EndPos = 0; // Позиция в контенте параграфа, на которой заканчиваетсяданный отрезок
this.W = 0;
this.Spaces = 0; // Количество пробелов в отрезке, без учета пробелов в конце отрезка
this.WEnd = 0; // Если есть знак конца параграфа в данном отрезке, то это его ширина
}
CParaLineRange.prototype =
......
......@@ -3551,6 +3551,8 @@ ParaRun.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange)
if ( true === PRSC.Word )
PRSC.Spaces += PRSC.SpacesCount;
PRSC.Range.WEnd = Item.Get_WidthVisible();
break;
}
}
......
......@@ -50,7 +50,8 @@ function CInlineLevelSdt()
this.Pr = new CSdtPr();
this.Type = para_InlineLevelSdt;
this.BoundsPaths = null;
this.BoundsPaths = null;
this.BoundsPathsStartPage = -1;
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
g_oTableId.Add(this, this.Id);
......@@ -212,7 +213,8 @@ CInlineLevelSdt.prototype.Get_WordEndPos = function(SearchPos, ContentPos, Depth
};
CInlineLevelSdt.prototype.GetBoundingPolygon = function()
{
if (null === this.BoundsPaths)
var StartPage = this.Paragraph.Get_StartPage_Absolute();
if (null === this.BoundsPaths || StartPage !== this.BoundsPathsStartPage)
{
var arrBounds = [], arrRects = [], CurPage = -1;
for (var Key in this.Bounds)
......@@ -223,7 +225,7 @@ CInlineLevelSdt.prototype.GetBoundingPolygon = function()
arrBounds.push(arrRects);
CurPage = this.Bounds[Key].PageInternal;
}
this.Bounds[Key].Page = this.Paragraph.Get_AbsolutePage(this.Bounds[Key].PageInternal);
arrRects.push(this.Bounds[Key]);
}
......@@ -234,6 +236,8 @@ CInlineLevelSdt.prototype.GetBoundingPolygon = function()
oPolygon.fill([arrBounds[nIndex]]);
this.BoundsPaths = this.BoundsPaths.concat(oPolygon.GetPaths(0));
}
this.BoundsPathsStartPage = StartPage;
}
return this.BoundsPaths;
......
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