Commit a67ceabf authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Исправлен баг с запросом первого параграфа в таблице (баг 19677).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50818 954022d7-b5bf-4e40-9824-e11837661b57
parent 15a47dea
...@@ -9148,21 +9148,24 @@ Paragraph.prototype = ...@@ -9148,21 +9148,24 @@ Paragraph.prototype =
else if ( type_Table === NextEl.GetType() ) else if ( type_Table === NextEl.GetType() )
{ {
var TableFirstParagraph = NextEl.Get_FirstParagraph(); var TableFirstParagraph = NextEl.Get_FirstParagraph();
var NextStyle = TableFirstParagraph.Style_Get(); if ( null != TableFirstParagraph && undefined != TableFirstParagraph )
var Next_Before = TableFirstParagraph.Get_CompiledPr2(false).ParaPr.Spacing.Before;
var Next_BeforeAuto = TableFirstParagraph.Get_CompiledPr2(false).ParaPr.Spacing.BeforeAutoSpacing;
var Cur_After = Pr.ParaPr.Spacing.After;
var Cur_AfterAuto = Pr.ParaPr.Spacing.AfterAutoSpacing;
if ( NextStyle === StyleId && true === Pr.ParaPr.ContextualSpacing )
{ {
Cur_After = this.Internal_CalculateAutoSpacing( Cur_After, Cur_AfterAuto, this ); var NextStyle = TableFirstParagraph.Style_Get();
Next_Before = this.Internal_CalculateAutoSpacing( Next_Before, Next_BeforeAuto, this ); var Next_Before = TableFirstParagraph.Get_CompiledPr2(false).ParaPr.Spacing.Before;
var Next_BeforeAuto = TableFirstParagraph.Get_CompiledPr2(false).ParaPr.Spacing.BeforeAutoSpacing;
var Cur_After = Pr.ParaPr.Spacing.After;
var Cur_AfterAuto = Pr.ParaPr.Spacing.AfterAutoSpacing;
if ( NextStyle === StyleId && true === Pr.ParaPr.ContextualSpacing )
{
Cur_After = this.Internal_CalculateAutoSpacing( Cur_After, Cur_AfterAuto, this );
Next_Before = this.Internal_CalculateAutoSpacing( Next_Before, Next_BeforeAuto, this );
Pr.ParaPr.Spacing.After = Math.max( Next_Before, Cur_After ) - Cur_After; Pr.ParaPr.Spacing.After = Math.max( Next_Before, Cur_After ) - Cur_After;
} }
else else
{ {
Pr.ParaPr.Spacing.After = this.Internal_CalculateAutoSpacing( Pr.ParaPr.Spacing.After, Cur_AfterAuto, this ); Pr.ParaPr.Spacing.After = this.Internal_CalculateAutoSpacing( Pr.ParaPr.Spacing.After, Cur_AfterAuto, this );
}
} }
} }
} }
......
...@@ -2518,6 +2518,9 @@ CTable.prototype = ...@@ -2518,6 +2518,9 @@ CTable.prototype =
// Получаем первый параграф первой ячейки. (Нужно для контроля ContextualSpacing) // Получаем первый параграф первой ячейки. (Нужно для контроля ContextualSpacing)
Get_FirstParagraph : function() Get_FirstParagraph : function()
{ {
if ( this.Content.length <= 0 || this.Content[0].Content.length <= 0 )
return null;
return this.Content[0].Content[0].Content.Get_FirstParagraph(); return this.Content[0].Content[0].Content.Get_FirstParagraph();
}, },
......
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