This commit is contained in:
Kathy Ruffing 2012-01-27 12:42:36 +00:00
parent b46aa35642
commit 7f43c906e7
2 changed files with 17 additions and 2 deletions

View File

@ -320,6 +320,12 @@ namespace Volian.Controls.Library
{
CleanUpClosedItems();
if (myItemInfo == null) return null;
// if this is an auto table of contents section, don't edit it:
if (myItemInfo.IsAutoTOCSection)
{
MessageBox.Show("This is an automatically generated 'Table of Contents' section. It is not editable. It is generated during Print.", "Item not Editable", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return SelectedDisplayTabItem;
}
_MyBar = GetParentBar(myItemInfo); // Get the docking bar associated with this item.
if (myItemInfo.MyContent.MyEntry == null) // If it is a Word document open in step editor
return OpenStepTabPage(myItemInfo);
@ -432,7 +438,12 @@ namespace Volian.Controls.Library
public void CloseWordItem(ItemInfo myItemInfo, bool isBeingDeleted)
{
CleanUpClosedItems();
string key = "Doc - " + myItemInfo.MyContent.MyEntry.MyDocument.DocID.ToString();
string key = "Doc - ";
// there is no entry if it is an auto table of contents:
if (myItemInfo.MyContent.MyEntry != null)
key = key + myItemInfo.MyContent.MyEntry.MyDocument.DocID.ToString();
else
key = key + "0";
DisplayTabItem myTabItem = null;
if (_MyDisplayTabItems.ContainsKey(key)) // If page open, close it
{

View File

@ -1581,7 +1581,11 @@ namespace Volian.Controls.Library
// get the config item for the steps section. there is an 'editable'
// flag used in metasections to define whether the steps should print.
// this flag can be toggle on the section's properties dialog.
bool EditSteps = !(MyItemInfo.MyConfig is SectionConfig && (MyItemInfo.MyConfig as SectionConfig).SubSection_Edit == "N");
// Only check the flag if the section has subsections because the
// default for the flag is not editable, and this would make non-metasections
// not editable.
bool hasMetaSubs = MyItemInfo.IsSection && MyItemInfo.Sections != null && MyItemInfo.Sections.Count>0;
bool EditSteps = !hasMetaSubs || (MyItemInfo.MyConfig is SectionConfig && (MyItemInfo.MyConfig as SectionConfig).SubSection_Edit == "Y");
if (EditSteps) AddChildAfter(MyItemInfo.Steps, expand);
if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel >= MyItemInfo.ColumnMode)