diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index 75369528..94085fc2 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -2165,21 +2165,11 @@ namespace Volian.Controls.Library protected Point TableLocation(StepSectionLayoutData myStepSectionLayoutData, int width) { // bug fix: B2016-111 - myParentEditItem was getting a null reference error when inserting a figure before/after a figure - EditItem myParentEditItem = _MyParentEditItem; - if (myParentEditItem == null) - { - EditItem parentEI = _MyPreviousEditItem; - while (parentEI._MyPreviousEditItem != null) - parentEI = parentEI._MyPreviousEditItem; - myParentEditItem = parentEI._MyParentEditItem; - } + EditItem myParentEditItem = MyParent; // Should center on parent unless it is a centered table type in the AER column or parent is another table type, then // walk up until finding a non-table type step'. (B2016-264: insert of centered eq off centered eq was not locating child equation correctly) EditItem aboveForLocation = myParentEditItem; - if (aboveForLocation.MyItemInfo.IsTable || aboveForLocation.MyItemInfo.IsRtfRaw || aboveForLocation.MyItemInfo.IsFigure) - { - while (aboveForLocation.MyItemInfo.IsFigure || aboveForLocation.MyItemInfo.IsRtfRaw || aboveForLocation.MyItemInfo.IsTable) aboveForLocation = aboveForLocation.MyParentEditItem; - } + while (aboveForLocation.MyItemInfo.IsFigure || aboveForLocation.MyItemInfo.IsRtfRaw || aboveForLocation.MyItemInfo.IsTable) aboveForLocation = aboveForLocation.MyParent;// B2017-248 int center = aboveForLocation.ContentLeft + aboveForLocation.ContentWidth / 2; int rightLimit = aboveForLocation.Right;