B2018-076 - Adding a substep to a second figure was causing the code to crrash

This commit is contained in:
Rich 2018-05-18 14:05:30 +00:00
parent 7c6f304957
commit 588edabb25

View File

@ -3645,8 +3645,12 @@ namespace Volian.Controls.Library
ContentWidth = myParentEditItem.ContentWidth; ContentWidth = myParentEditItem.ContentWidth;
if (itemInfo.IsStep && itemInfo.MyParent.IsFigure) if (itemInfo.IsStep && itemInfo.MyParent.IsFigure)
{ {
ContentWidth = myParentEditItem.MyParentEditItem.ContentWidth; // B2018-076 _ Handle Multiple Tables or Figure where Parent is null and Previous is not null
Left = myParentEditItem.MyParentEditItem.Left + myParentEditItem.MyParentEditItem.TabLeft; // B2017-129 fixed null reference EditItem mypar = myParentEditItem;
while (mypar.MyParentEditItem == null && mypar.MyPreviousEditItem != null)
mypar = mypar.MyPreviousEditItem;
ContentWidth = mypar.MyParentEditItem.ContentWidth;
Left = mypar.MyParentEditItem.Left + mypar.MyParentEditItem.TabLeft; // B2017-129 fixed null reference
} }
if (myChildRelation == ChildRelation.None) if (myChildRelation == ChildRelation.None)