Fixed crash when you selected the Open button on the Library Document tab in the Tools panel. Open button is only available for library documents with zero references.

If the open library document is not referenced, then save changes but don’t generate a PDF.
This commit is contained in:
2016-05-26 15:25:47 +00:00
parent 008a1e67eb
commit f763a9a868
3 changed files with 14 additions and 7 deletions

View File

@@ -810,7 +810,7 @@ namespace Volian.Controls.Library
foreach (object itm in b.Items)
{
DisplayTabItem myTabItem = itm as DisplayTabItem;
if (myTabItem != null && myTabItem.MyStepTabPanel != null)
if (myTabItem != null && myTabItem.MyStepTabPanel != null && myItemInfo != null)
if (myTabItem.MyStepTabPanel.MyProcedureItemInfo.ItemID == myItemInfo.MyProcedure.ItemID)
return b;
}
@@ -1041,6 +1041,7 @@ namespace Volian.Controls.Library
}
public DisplayTabItem OpenDSOTabPage(DocumentInfo myDocumentInfo)
{
_MyBar = GetParentBar(null); // B2016-131 - allow open of a non-referenced library document
CleanUpClosedItems();
DisplayTabItem pg = null;
string key = "Doc - " + myDocumentInfo.DocID;
@@ -1048,7 +1049,7 @@ namespace Volian.Controls.Library
pg = _MyDisplayTabItems[key];
else
{
if (DSOTabPanel.Count > 18) // Limit the number of open document pages to 18
if (DSOTabPanel.Count > DSOTabPanel.MSWordLimit) //18) // Limit the number of open document pages to 18
{
MessageBox.Show("Too many Word Documents Open. Please close one of the Documents before attempting to open another");
return null;