Commit 6cc49fd9 authored by Ilya Kirillov's avatar Ilya Kirillov

Bug #32109 Устранено падение при работе с нумерацией.

parent 1fa15bbc
...@@ -7376,20 +7376,24 @@ Paragraph.prototype = ...@@ -7376,20 +7376,24 @@ Paragraph.prototype =
{ {
if ( undefined != OldNumPr && undefined != OldNumPr.NumId ) if ( undefined != OldNumPr && undefined != OldNumPr.NumId )
{ {
var Lvl = this.Parent.Get_Numbering().Get_AbstractNum(OldNumPr.NumId).Lvl[OldNumPr.Lvl]; var Num = this.Parent.Get_Numbering().Get_AbstractNum(OldNumPr.NumId);
if ( undefined != Lvl && undefined != Lvl.ParaPr.Ind && undefined != Lvl.ParaPr.Ind.Left ) if (Num)
{ {
var CurParaPr = this.Get_CompiledPr2(false).ParaPr; var Lvl = Num.Lvl[OldNumPr.Lvl];
var Left = CurParaPr.Ind.Left + CurParaPr.Ind.FirstLine; if ( undefined != Lvl && undefined != Lvl.ParaPr.Ind && undefined != Lvl.ParaPr.Ind.Left )
var NumLeftCorrection = ( undefined != Lvl.ParaPr.Ind.FirstLine ? Math.abs( Lvl.ParaPr.Ind.FirstLine ) : 0 ); {
var CurParaPr = this.Get_CompiledPr2(false).ParaPr;
var Left = CurParaPr.Ind.Left + CurParaPr.Ind.FirstLine;
var NumLeftCorrection = ( undefined != Lvl.ParaPr.Ind.FirstLine ? Math.abs( Lvl.ParaPr.Ind.FirstLine ) : 0 );
var NewFirstLine = 0; var NewFirstLine = 0;
var NewLeft = Left < 0 ? Left : Math.max(0, Left - NumLeftCorrection); var NewLeft = Left < 0 ? Left : Math.max(0, Left - NumLeftCorrection);
History.Add( this, { Type : historyitem_Paragraph_Ind_Left, New : NewLeft, Old : this.Pr.Ind.Left } ); History.Add( this, { Type : historyitem_Paragraph_Ind_Left, New : NewLeft, Old : this.Pr.Ind.Left } );
History.Add( this, { Type : historyitem_Paragraph_Ind_First, New : NewFirstLine, Old : this.Pr.Ind.FirstLine } ); History.Add( this, { Type : historyitem_Paragraph_Ind_First, New : NewFirstLine, Old : this.Pr.Ind.FirstLine } );
this.Pr.Ind.Left = NewLeft; this.Pr.Ind.Left = NewLeft;
this.Pr.Ind.FirstLine = NewFirstLine; this.Pr.Ind.FirstLine = NewFirstLine;
}
} }
} }
} }
......
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