This commit is contained in:
Kathy Ruffing 2010-11-23 14:57:31 +00:00
parent 60c807b0bd
commit be255b4758

View File

@ -73,7 +73,12 @@ namespace Volian.Controls.Library
/// </summary>
public bool IsDirty
{
get { return _MyDSOFramer.IsDirty; }
get
{
if (_MyDSOFramer == null) return false;
LBDocumentClass doc = new LBDocumentClass(_MyDSOFramer.ActiveDocument);
return !doc.Saved;
}
}
public E_ViewMode PanelViewEditMode = E_ViewMode.Edit;
#endregion
@ -172,14 +177,33 @@ namespace Volian.Controls.Library
private void CheckForSymbolCharacters(LBDocumentClass doc)
{
if (doc.HasSymbolCharacters)
if (doc.FontHasSymbolCharacters != null)
{
if (MessageBox.Show("This document contains Symbol Characters.\r\n\r\nDo you want to correct this? (Select Yes!)\r\n\r\nAlso, contact Rich, Kathy or John and let them know which Procedure and Section.",
"Replace Symbol Characters", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
// do a string for the log message, depending if this is a libdoc.
string msg = null;
if (MyDocumentInfo.LibTitle == null || MyDocumentInfo.LibTitle == "")
{
if (MyDocumentInfo.DocumentEntryCount>0)
msg = string.Format("Procedure = {0}, Section {1}", MyDocumentInfo.DocumentEntries[0].MyContent.ContentItems[0].MyProcedure, MyDocumentInfo.DocumentEntries[0].MyContent.ContentItems[0].DisplayText);
else
msg = string.Format("Procedure and Section can't be determined");
}
else
msg = string.Format("Library Document: {0}", MyDocumentInfo.LibTitle);
if (doc.AttemptToFixASymbolCharacter()) // font is installed correctly, 'fix' this file.
{
MessageBox.Show(string.Format("This document uses the font {0}, which previously had an error.\r\nThe program will attempt to fix the problem for this Word section.", doc.FontHasSymbolCharacters),
"Font Being Corrected", MessageBoxButtons.OK);
doc.FixSymbolCharacters();
_MyLog.Info(string.Format("Font problem being fixed in Font: {0}, {1}.",doc.FontHasSymbolCharacters, msg));
}
else
{
MessageBox.Show(string.Format("This document uses the font {0}, which has an error.\r\n\r\nReinstall this font.", doc.FontHasSymbolCharacters),
"Reinstall Font", MessageBoxButtons.OK);
_MyLog.Info(string.Format("Font problem found in Font: {0}, {1}.",doc.FontHasSymbolCharacters, msg));
}
}
}
private void InitializeWordDocument(LBDocumentClass doc)
@ -397,7 +421,7 @@ namespace Volian.Controls.Library
/// <returns></returns>
public bool SaveDirty()
{
if (_MyDSOFramer != null && _MyDSOFramer.IsDirty)
if (IsDirty)
{
// Unfortunately, the only way to handle view mode for DSO Framer is to not save.
if (PanelViewEditMode == E_ViewMode.View)