B2018-025: Proms crashes opening Working Draft if associated enhanced Working Draft had been deleted

This commit is contained in:
2018-03-01 15:34:22 +00:00
parent 181008c9f9
commit 60b83e9926
3 changed files with 48 additions and 7 deletions

View File

@@ -2950,7 +2950,23 @@ namespace Volian.Controls.Library
{
foreach (DVEnhancedDocument dve in dvc.MyEnhancedDocuments)
{
if (dve.Type != 0) DocVersion.Delete(dve.VersionID);
if (dve.Type != 0)
DocVersion.Delete(dve.VersionID);
else
{
// B2018-025: for the input source docversion (id), clear out its enhanced document link information
// dvi is the source, remove this (_LastDocVersionInfo) background link from the source's config
DocVersionInfo dvi = DocVersionInfo.Get(dve.VersionID);
DocVersionConfig dvci = dvi.MyConfig as DocVersionConfig;
dvci.RemoveEnhancedLink(_LastDocVersionInfo.VersionID);
string dvccfg = dvci.ToString();
using (DocVersion dv = dvi.Get())
{
dv.Config = dvccfg;
dv.Save();
DocVersionInfo.Refresh(dv);
}
}
}
}
DocVersion.Delete(_LastDocVersionInfo.VersionID);