Speed-up code to find symbol characters
Refresh DSOFramer screen on open
This commit is contained in:
parent
af2d1f00de
commit
e01c1c387b
@ -308,19 +308,24 @@ namespace LBWordLibrary
|
|||||||
//return _RegFindSymbol.IsMatch(myText);
|
//return _RegFindSymbol.IsMatch(myText);
|
||||||
MatchCollection problems = _RegFindSymbol.Matches(myText);
|
MatchCollection problems = _RegFindSymbol.Matches(myText);
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
List<string> alreadyProcessed = new List<string>();
|
||||||
foreach (Match problem in problems)
|
foreach (Match problem in problems)
|
||||||
{
|
{
|
||||||
myRange.Start = problem.Index + offset;
|
if (!alreadyProcessed.Contains(problem.Value))
|
||||||
myRange.End = problem.Index + problem.Length + offset;
|
|
||||||
int newOffset = FindRangeOffset(myRange, problem, offset, end);
|
|
||||||
if (IsSymbolFont(myRange.Font.Name))
|
|
||||||
{
|
{
|
||||||
Console.WriteLine("Font '{0}' has Symbols", myRange.Font.Name);
|
myRange.Start = problem.Index + offset;
|
||||||
//return true;
|
myRange.End = problem.Index + problem.Length + offset;
|
||||||
|
int newOffset = FindRangeOffset(myRange, problem, offset, end);
|
||||||
|
if (IsSymbolFont(myRange.Font.Name))
|
||||||
|
{
|
||||||
|
//Console.WriteLine("Font '{0}' has Symbols", myRange.Font.Name);
|
||||||
|
//return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return myRange.Font.Name;
|
||||||
|
offset = newOffset;
|
||||||
|
alreadyProcessed.Add(problem.Value);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
return myRange.Font.Name;
|
|
||||||
offset = newOffset;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,12 @@ namespace Volian.Controls.Library
|
|||||||
public DisplayTabItem MyDisplayTabItem
|
public DisplayTabItem MyDisplayTabItem
|
||||||
{
|
{
|
||||||
get { return _MyDisplayTabItem; }
|
get { return _MyDisplayTabItem; }
|
||||||
set { _MyDisplayTabItem = value; }
|
set
|
||||||
|
{
|
||||||
|
_MyDisplayTabItem = value;
|
||||||
|
_MyDisplayTabItem.Visible = false;
|
||||||
|
_MyDisplayTabItem.Visible = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DocumentInfo record for the Word document
|
/// DocumentInfo record for the Word document
|
||||||
|
Loading…
x
Reference in New Issue
Block a user