From be255b4758e425360eb85d03057a922d3dbd0762 Mon Sep 17 00:00:00 2001 From: Kathy Date: Tue, 23 Nov 2010 14:57:31 +0000 Subject: [PATCH] --- PROMS/Volian.Controls.Library/DSOTabPanel.cs | 38 ++++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DSOTabPanel.cs b/PROMS/Volian.Controls.Library/DSOTabPanel.cs index 2a43612f..3d2169dc 100644 --- a/PROMS/Volian.Controls.Library/DSOTabPanel.cs +++ b/PROMS/Volian.Controls.Library/DSOTabPanel.cs @@ -73,7 +73,12 @@ namespace Volian.Controls.Library /// 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 /// 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)