Compare commits

..

No commits in common. "2f974d7b52c85a30fc3652090c89ddcecbc8a51d" and "28e4bdda29775261eb00bfdfb7ddb64bf2b9142e" have entirely different histories.

View File

@ -1542,7 +1542,7 @@ namespace ROEditor
//only close if they say "Yes, they want to"
protected override void OnFormClosing(FormClosingEventArgs e)
{
if (this.DialogResult != System.Windows.Forms.DialogResult.OK && IsPendingChange() && !CloseCancel())
if (this.DialogResult != System.Windows.Forms.DialogResult.OK && !CloseCancel())
{
e.Cancel = true;
}
@ -1558,49 +1558,6 @@ namespace ROEditor
return result == DialogResult.Yes;
}
//return true if a field has been modified
private bool IsPendingChange()
{
if (origRetVal != this.tbRetVal.Text)
return true;
if (origMenuItem != this.tbMenuVal.Text)
return true;
// check if in use records have changed
string inuserecs = null;
ROField rof;
for (int i = 0; i < InUseList.Count; i++)
{
rof = (ROField)InUseList[i];
if (rof.GetFieldname != null) //DO YET: why null?
{
inuserecs = inuserecs + rof.GetRecID;
if (i + 1 < InUseList.Count) inuserecs = inuserecs + " ";
}
}
if (inuserecs != origFieldsInUse)
return true;
//check if applicability fields have changed
string applicfieldrecs = null;
for (int i = 0; i < InUseApplcList.Count; i++)
{
rof = (ROField)InUseApplcList[i];
if (rof.GetFieldname != null)
{
applicfieldrecs = applicfieldrecs + rof.GetRecID;
if (i + 1 < InUseApplcList.Count) applicfieldrecs = applicfieldrecs + " ";
}
}
if (applicfieldrecs != origApplicFields)
return true;
//nothing has changed
return false;
}
#endregion
}
}