Log Symbols being used in MSWord Documents

Improve Performance by not loading all ROImages into memory
This commit is contained in:
Rich 2012-04-11 15:45:46 +00:00
parent 7eac3bab45
commit 0b0e62a2d7
2 changed files with 8 additions and 2 deletions

View File

@ -215,6 +215,7 @@ namespace LBWordLibrary
}
public partial class LBDocumentClass : LBComObject
{
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public void SaveAs2000(string fileName)
{
if (fileName.ToUpper().EndsWith("DOC"))
@ -309,6 +310,7 @@ namespace LBWordLibrary
MatchCollection problems = _RegFindSymbol.Matches(myText);
int offset = 0;
List<string> alreadyProcessed = new List<string>();
List<string> fontHasSymbols = new List<string>();
foreach (Match problem in problems)
{
if (!alreadyProcessed.Contains(problem.Value))
@ -316,8 +318,11 @@ namespace LBWordLibrary
myRange.Start = problem.Index + offset;
myRange.End = problem.Index + problem.Length + offset;
int newOffset = FindRangeOffset(myRange, problem, offset, end);
if (IsSymbolFont(myRange.Font.Name))
string fontName = myRange.Font.Name;
if (IsSymbolFont(fontName) && !fontHasSymbols.Contains(fontName))
{
_MyLog.InfoFormat("Font '{0}' has Symbols", fontName);
fontHasSymbols.Add(fontName);
//Console.WriteLine("Font '{0}' has Symbols", myRange.Font.Name);
//return true;
}

View File

@ -140,7 +140,8 @@ namespace VEPROMS.CSLA.Library
get
{
CanReadProperty("MyROFst", true);
if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.Get(_ROFstID);
//if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.Get(_ROFstID);
if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.GetJustROFst(_ROFstID);// Improve performance by not loading all ROImages
return _MyROFst;
}
}