Commit 5bb207fa authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug #33003 Fixed an issue with zero width frame.

parent 0c6199da
......@@ -3065,7 +3065,7 @@ CDocument.prototype.private_RecalculateFlowParagraph = function(RecalcIn
if (-1 === FrameW && 1 === FlowCount && 1 === Element.Lines.length && undefined === FramePr.Get_W())
{
FrameW = Element.Lines[0].Ranges[0].W;
FrameW = Element.GetAutoWidthForDropCap();
var ParaPr = Element.Get_CompiledPr2(false).ParaPr;
FrameW += ParaPr.Ind.Left + ParaPr.Ind.FirstLine;
......
......@@ -788,7 +788,7 @@ CDocumentContent.prototype.Recalculate_Page = function(PageIndex,
// отсутствует, когда, у нас ровно 1 параграф, с 1 строкой.
if (-1 === FrameW && 1 === FlowCount && 1 === Element.Lines.length && undefined === FramePr.Get_W())
{
FrameW = Element.Lines[0].Ranges[0].W;
FrameW = Element.GetAutoWidthForDropCap();
var ParaPr = Element.Get_CompiledPr2(false).ParaPr;
FrameW += ParaPr.Ind.Left + ParaPr.Ind.FirstLine;
......
......@@ -14009,6 +14009,28 @@ Paragraph.prototype.Get_FootnotesList = function(oEngine)
return;
}
};
Paragraph.prototype.GetAutoWidthForDropCap = function()
{
if (this.Is_Empty())
{
var oEndRun = this.Content[this.Content.length - 1];
if (!oEndRun || oEndRun.Type !== para_Run)
return 0;
var oParaEnd = oEndRun.GetParaEnd();
if (!oParaEnd)
return 0;
return oParaEnd.Get_WidthVisible();
}
else
{
if (this.Lines.length <= 0 || this.Lines[0].Ranges.length <= 0)
return 0;
return this.Lines[0].Ranges[0].W;
}
};
var pararecalc_0_All = 0;
var pararecalc_0_None = 1;
......
......@@ -11195,6 +11195,16 @@ ParaRun.prototype.Is_UseInDocument = function()
{
return (this.Paragraph && true === this.Paragraph.Is_UseInDocument() && true === this.Is_UseInParagraph() ? true : false);
};
ParaRun.prototype.GetParaEnd = function()
{
for (var nIndex = 0, nCount = this.Content.length; nIndex < nCount; ++nIndex)
{
if (this.Content[nIndex].Type === para_End)
return this.Content[nIndex];
}
return null;
};
function CParaRunStartState(Run)
{
......
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