B2017-248 If a sibling Table, Figure or Equation has a sub-table or figure or equation, the code would crash when trying to display it. The code was changed to use the MyParent property which is never null rather than the MyParentEditItem property which can be null.
This commit is contained in:
parent
9558e3a81a
commit
a201611858
@ -2165,21 +2165,11 @@ namespace Volian.Controls.Library
|
|||||||
protected Point TableLocation(StepSectionLayoutData myStepSectionLayoutData, int width)
|
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
|
// bug fix: B2016-111 - myParentEditItem was getting a null reference error when inserting a figure before/after a figure
|
||||||
EditItem myParentEditItem = _MyParentEditItem;
|
EditItem myParentEditItem = MyParent;
|
||||||
if (myParentEditItem == null)
|
|
||||||
{
|
|
||||||
EditItem parentEI = _MyPreviousEditItem;
|
|
||||||
while (parentEI._MyPreviousEditItem != null)
|
|
||||||
parentEI = parentEI._MyPreviousEditItem;
|
|
||||||
myParentEditItem = parentEI._MyParentEditItem;
|
|
||||||
}
|
|
||||||
// Should center on parent unless it is a centered table type in the AER column or parent is another table type, then
|
// 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)
|
// 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;
|
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.MyParent;// B2017-248
|
||||||
{
|
|
||||||
while (aboveForLocation.MyItemInfo.IsFigure || aboveForLocation.MyItemInfo.IsRtfRaw || aboveForLocation.MyItemInfo.IsTable) aboveForLocation = aboveForLocation.MyParentEditItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
int center = aboveForLocation.ContentLeft + aboveForLocation.ContentWidth / 2;
|
int center = aboveForLocation.ContentLeft + aboveForLocation.ContentWidth / 2;
|
||||||
int rightLimit = aboveForLocation.Right;
|
int rightLimit = aboveForLocation.Right;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user