Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ff9ade75d4 | |||
| cfd5498521 | |||
| 9b7c30e1cd | |||
| 670e5d7fa9 | |||
| 8258235611 | |||
| 4d97f29943 | |||
| ab8d59eb2d | |||
| c324fa69b2 | |||
| 1cdb9b4cc2 | |||
| f47fa49b80 | |||
| 6ade96c7ef | |||
| 61d31a3c67 | |||
| 014509ea30 | |||
| 1ce1a45ca6 | |||
| b6da13a653 | |||
| 604b4d1751 | |||
| 874aaf2857 | |||
| 17a28def4e | |||
| e72a1aa9e7 | |||
| 7b96ef1b4c | |||
| ea048e6d82 | |||
| 109abfb4ad | |||
| 3f662ab19d | |||
| b0de38909a | |||
| 267de44103 | |||
| b7b0e55d94 | |||
| c0d12f5721 | |||
| 27a945485f | |||
| d76c81a9d8 | |||
| 143a3622dd | |||
| 75992293c6 | |||
| 0e004828b3 | |||
| 714751f404 | |||
| 27576e946e | |||
| e548dddcbd | |||
| 8cbc8c497e | |||
| c328140441 | |||
| 7b649c4a62 |
+118
-40
@@ -456,7 +456,7 @@ namespace Baseline
|
|||||||
switch (myLast)
|
switch (myLast)
|
||||||
{
|
{
|
||||||
case LastWas.Pagination:
|
case LastWas.Pagination:
|
||||||
line = OpenPDF(line);
|
OpenPDF(line);
|
||||||
break;
|
break;
|
||||||
case LastWas.Baseline: // TODO: Need to add code here to open matching file
|
case LastWas.Baseline: // TODO: Need to add code here to open matching file
|
||||||
OpenOnePDF(myLine,1);
|
OpenOnePDF(myLine,1);
|
||||||
@@ -479,7 +479,7 @@ namespace Baseline
|
|||||||
switch (myLast)
|
switch (myLast)
|
||||||
{
|
{
|
||||||
case LastWas.Pagination:
|
case LastWas.Pagination:
|
||||||
line = OpenPDF(line);
|
OpenPDF(line);
|
||||||
break;
|
break;
|
||||||
case LastWas.Baseline: // TODO: Need to add code here to open matching file
|
case LastWas.Baseline: // TODO: Need to add code here to open matching file
|
||||||
OpenOnePDF(myLine,2);
|
OpenOnePDF(myLine,2);
|
||||||
@@ -491,34 +491,99 @@ namespace Baseline
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string exePath;
|
|
||||||
private string OpenPDF(string line)
|
/// <summary>
|
||||||
|
/// This will return the full path to the PDF file
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fi"></param>
|
||||||
|
/// <param name="patern"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private string GetPFDFileAndPath(FileInfo fi, string patern)
|
||||||
{
|
{
|
||||||
int page = int.Parse(line.Substring(0, 6));
|
string[] fileList = Directory.GetFiles(fi.DirectoryName, patern);
|
||||||
|
// sort the list of file list
|
||||||
|
Array.Sort((string[])fileList);
|
||||||
|
return fileList.First(); // the PDF file that we what should be top of the list then.
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This will parse out the procedure number for the PROMS ShortPath representation of a procedure section or step part
|
||||||
|
/// In the PROMS ShortPath, ".S" is used to delimit the procedure number, section then uses "..S" for the step parts
|
||||||
|
/// This method was written to handle cases where ".S" is used as part of the procedure number
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="txt"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private string ParseOutProcedureNumberFromLine(string txt)
|
||||||
|
{
|
||||||
|
// old logic was looking for the first occurence of ".S" in the txt string as the ending point of the procedure nuumber
|
||||||
|
// Beaver Valley has a procedure number "1.SBGEN" in which the old logic would not work
|
||||||
|
// 1.SBGEN.SC. ==> short path of attachment section "C"
|
||||||
|
// 1.SBGEN.SC..S1. ==> short path of Step 1 in attachment section "C"
|
||||||
|
string rtnstr = null;
|
||||||
|
int lidx = -1;
|
||||||
|
// if the item is to a high levels step or sub-step the short path as "..S" for each part of the step
|
||||||
|
// so look for the last occurence of ".." which will be the end of the section information
|
||||||
|
lidx = txt.LastIndexOf("..");
|
||||||
|
if (lidx > 0)
|
||||||
|
{
|
||||||
|
lidx = txt.LastIndexOf(".S", lidx); // this will position us to the end of the procedure number
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lidx = txt.LastIndexOf(".S"); // this will position us to the end of the procedure number if there was no step information
|
||||||
|
}
|
||||||
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
|
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
|
||||||
line = line.Substring(8, line.IndexOf(".S") - 8).Replace("/", "_").Replace("\\", "_");
|
rtnstr = txt.Substring(8, lidx - 8).Replace("/", "_").Replace("\\", "_");
|
||||||
|
return rtnstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
string exePath;
|
||||||
|
private void OpenPDF(string line)
|
||||||
|
{
|
||||||
|
int pageNum = int.Parse(line.Substring(0, 6));
|
||||||
|
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
|
||||||
|
string ProcNum = ParseOutProcedureNumberFromLine(line);
|
||||||
|
string procPatern = string.Format("*{0}*.pdf", string.IsNullOrEmpty(line) ? "noProcNumber" : ProcNum);
|
||||||
|
|
||||||
FindFile ff = lbDifferent.SelectedItem as FindFile;
|
FindFile ff = lbDifferent.SelectedItem as FindFile;
|
||||||
FileInfo fi1 = new FileInfo(ff.File1);
|
FileInfo fi1 = new FileInfo(ff.File1);
|
||||||
FileInfo fi2 = new FileInfo(ff.File2);
|
FileInfo fi2 = new FileInfo(ff.File2);
|
||||||
|
string PDFfileName1 = GetPFDFileAndPath(fi1,procPatern);
|
||||||
|
string PDFfileName2 = GetPFDFileAndPath(fi2,procPatern);
|
||||||
|
if (string.IsNullOrEmpty(PDFfileName1) || string.IsNullOrEmpty(PDFfileName2)) return;
|
||||||
|
|
||||||
// If you don't know where the Reader executable is for PDFs Open a PDF and Check to see where the path points
|
// If you don't know where the Reader executable is for PDFs Open a PDF and Check to see where the path points
|
||||||
if (exePath == null)
|
if (exePath == null)
|
||||||
{
|
{
|
||||||
System.Diagnostics.Process p = System.Diagnostics.Process.Start(fi1.DirectoryName + "\\" + line + ".pdf");
|
try
|
||||||
exePath = TryToGetPath(p);
|
{
|
||||||
p.Kill(); // No need to keep it open
|
System.Diagnostics.Process p = System.Diagnostics.Process.Start(PDFfileName1);
|
||||||
|
exePath = TryToGetPath(p);
|
||||||
|
p.Kill(); // No need to keep it open
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Application.DoEvents();
|
||||||
|
string msg = string.Format("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||||
|
Console.WriteLine(msg);
|
||||||
|
MessageBox.Show(msg, "Error opening default PDF Viewer");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open the first PDF on a Specific Page
|
// Open the first PDF on a Specific Page
|
||||||
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", page) + fi1.DirectoryName + "\\" + line + ".pdf ");
|
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format(" /A \"page={0}\" \"{1}\" ", pageNum,PDFfileName1));
|
||||||
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
|
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
|
||||||
// Move the PDF Reader window to 0,0
|
// Move the PDF Reader window to 0,0
|
||||||
MoveProcess(p1, 0, 0);
|
MoveProcess(p1, 0, 0);
|
||||||
// Open the first PDF on a Specific Page
|
|
||||||
System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", page) + fi2.DirectoryName + "\\" + line + ".pdf ");
|
// Open the second PDF on a Specific Page
|
||||||
|
System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format(" /A \"page={0}\" \"{1}\" ", pageNum, PDFfileName2));
|
||||||
System.Diagnostics.Process p2 = System.Diagnostics.Process.Start(psi2);
|
System.Diagnostics.Process p2 = System.Diagnostics.Process.Start(psi2);
|
||||||
// Move the PDF Reader window to 960,0
|
// Move the PDF Reader window to 960,0
|
||||||
// TODO: This Offset could be a Setting
|
// TODO: This Offset could be a Setting
|
||||||
MoveProcess(p2, 960, 0);
|
MoveProcess(p2, 960, 0);
|
||||||
return line;
|
return;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Try to get the location of the PDF Reader executable
|
/// Try to get the location of the PDF Reader executable
|
||||||
@@ -530,7 +595,7 @@ namespace Baseline
|
|||||||
p.WaitForInputIdle();
|
p.WaitForInputIdle();
|
||||||
while (p.MainModule == null)
|
while (p.MainModule == null)
|
||||||
{
|
{
|
||||||
Console.WriteLine("{0} - {1}", p.MainWindowTitle,p.ProcessName);
|
Console.WriteLine("{0} - {1}", p.MainWindowTitle, p.ProcessName);
|
||||||
p.WaitForInputIdle();
|
p.WaitForInputIdle();
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
}
|
}
|
||||||
@@ -594,40 +659,52 @@ namespace Baseline
|
|||||||
/// <param name="list"></param>
|
/// <param name="list"></param>
|
||||||
private void OpenOnePDF(Line myLine, int list)
|
private void OpenOnePDF(Line myLine, int list)
|
||||||
{
|
{
|
||||||
|
if (myLine == null) return; // no PDF to open
|
||||||
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
|
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
|
||||||
string proc = myLine.MyProc.Number.Replace("/","_").Replace("\\","_");
|
string proc = myLine.MyProc.Number.Replace("/","_").Replace("\\","_");
|
||||||
|
|
||||||
|
// if no procedure number, PROMS creates pdf filename "NoProcNumber.pdf"
|
||||||
|
// create pattern to use to get the PDF from the directory
|
||||||
|
// add wildcards (*) to file the file if any prefix or suffix was added to the filename
|
||||||
|
string procPatern = string.Format("*{0}*.pdf", proc == string.Empty ? "noProcNumber" : proc);
|
||||||
int pagenum = myLine.MyPage.Number;
|
int pagenum = myLine.MyPage.Number;
|
||||||
FindFile ff = lbDifferent.SelectedItem as FindFile;
|
FindFile ff = lbDifferent.SelectedItem as FindFile;
|
||||||
FileInfo fi1 = new FileInfo(ff.File1);
|
string PDFfileName = null;
|
||||||
FileInfo fi2 = new FileInfo(ff.File2);
|
|
||||||
if (exePath == null)
|
|
||||||
{
|
|
||||||
System.Diagnostics.Process p = System.Diagnostics.Process.Start(fi1.DirectoryName + "\\" + proc + ".pdf");
|
|
||||||
while (exePath == null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
exePath = p.MainModule.FileName;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Application.DoEvents();
|
|
||||||
Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
p.Kill();
|
|
||||||
}
|
|
||||||
if (list == 1)
|
if (list == 1)
|
||||||
{
|
{
|
||||||
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", pagenum) + fi1.DirectoryName + "\\" + proc + ".pdf ");
|
FileInfo fi1 = new FileInfo(ff.File1);
|
||||||
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
|
PDFfileName = GetPFDFileAndPath(fi1, procPatern);
|
||||||
}
|
}
|
||||||
else
|
else // list == 2
|
||||||
{
|
{
|
||||||
System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", pagenum) + fi2.DirectoryName + "\\" + proc + ".pdf ");
|
FileInfo fi2 = new FileInfo(ff.File2);
|
||||||
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi2);
|
PDFfileName = GetPFDFileAndPath(fi2, procPatern);
|
||||||
}
|
}
|
||||||
|
if (string.IsNullOrEmpty(PDFfileName)) return; // no PDF to open
|
||||||
|
|
||||||
|
// if exePath is null, then open the found PDF with the default PDF viewer and
|
||||||
|
// capture/save the entire name and path of the default PDF viewer
|
||||||
|
if (exePath == null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
System.Diagnostics.Process tp = System.Diagnostics.Process.Start(PDFfileName);
|
||||||
|
exePath = TryToGetPath(tp);
|
||||||
|
tp.Kill();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Application.DoEvents();
|
||||||
|
string msg = string.Format("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||||
|
Console.WriteLine(msg);
|
||||||
|
MessageBox.Show(msg, "Error opening default PDF Viewer");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// open the PDF and jump to the page number
|
||||||
|
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A \"page={0}\" \"{1}\" ", pagenum,PDFfileName));
|
||||||
|
psi1.UseShellExecute = false;
|
||||||
|
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Perform Debug Meta file comparison for all of the folders within the automated testing folders
|
/// Perform Debug Meta file comparison for all of the folders within the automated testing folders
|
||||||
@@ -709,11 +786,12 @@ namespace Baseline
|
|||||||
private void lbProcedures_SelectedIndexChanged(object sender, EventArgs e)
|
private void lbProcedures_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//Initialize Results List Box
|
//Initialize Results List Box
|
||||||
lbResults1.Items.Clear();
|
|
||||||
Procedure myProc = lbProcedures.SelectedItem as Procedure;
|
Procedure myProc = lbProcedures.SelectedItem as Procedure;
|
||||||
|
if (myProc == null) return; // clicked on the white space (blank line) in the list of different procedures
|
||||||
//TODO: May need to consider if there are duplicate procedure numers and titles
|
//TODO: May need to consider if there are duplicate procedure numers and titles
|
||||||
Procedure myProc1 = MyProcs1.Find(x => x.Number == myProc.Number && x.Title == myProc.Title);
|
Procedure myProc1 = MyProcs1.Find(x => x.Number == myProc.Number && x.Title == myProc.Title);
|
||||||
// Build the results ListBox for the left window
|
// Build the results ListBox for the left window
|
||||||
|
lbResults1.Items.Clear();
|
||||||
if (myProc1 != null)
|
if (myProc1 != null)
|
||||||
{
|
{
|
||||||
foreach (Page myPage in myProc1.MyPages)
|
foreach (Page myPage in myProc1.MyPages)
|
||||||
|
|||||||
@@ -422,150 +422,6 @@ namespace LBWordLibrary
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/// <summary>
|
|
||||||
/// If document contains symbol characters, returns problem font.
|
|
||||||
/// </summary>
|
|
||||||
public string FontHasSymbolCharacters
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
LBRange myRange = Range();
|
|
||||||
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
|
|
||||||
myRange.Start = 0;
|
|
||||||
int end = myRange.End;
|
|
||||||
string myText = GetRangeText(myRange);
|
|
||||||
//return _RegFindSymbol.IsMatch(myText);
|
|
||||||
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))
|
|
||||||
{
|
|
||||||
myRange.Start = problem.Index + offset;
|
|
||||||
myRange.End = problem.Index + problem.Length + offset;
|
|
||||||
int newOffset = FindRangeOffset(myRange, problem, offset, end);
|
|
||||||
string fontName = myRange.Font.Name;
|
|
||||||
if (IsSymbolFont(fontName))
|
|
||||||
{
|
|
||||||
if( !fontHasSymbols.Contains(fontName))
|
|
||||||
{
|
|
||||||
fontHasSymbols.Add(fontName);
|
|
||||||
// Found symbol font
|
|
||||||
_MyLog.InfoFormat("Font '{0}' has Symbols", fontName);
|
|
||||||
}
|
|
||||||
//Console.WriteLine("Font '{0}' has Symbols", myRange.Font.Name);
|
|
||||||
//return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return myRange.Font.Name;
|
|
||||||
offset = newOffset;
|
|
||||||
alreadyProcessed.Add(problem.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Debug Tool - Return a string containing a list of the fonts that have symbol characters.
|
|
||||||
/// </summary>
|
|
||||||
public string FontsHaveSymbolCharacters
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string sep = "";
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
List<string> fonts=new List<string>();
|
|
||||||
LBRange myRange = Range();
|
|
||||||
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
|
|
||||||
myRange.Start = 0;
|
|
||||||
int end = myRange.End;
|
|
||||||
string myText = GetRangeText(myRange);
|
|
||||||
//return _RegFindSymbol.IsMatch(myText);
|
|
||||||
MatchCollection problems = _RegFindSymbol.Matches(myText);
|
|
||||||
int offset = 0;
|
|
||||||
foreach (Match problem in problems)
|
|
||||||
{
|
|
||||||
myRange.Start = problem.Index + offset;
|
|
||||||
myRange.End = problem.Index + problem.Length + offset;
|
|
||||||
int newOffset = FindRangeOffset(myRange, problem, offset, end);
|
|
||||||
if (!fonts.Contains(myRange.Font.Name))
|
|
||||||
{
|
|
||||||
fonts.Add(myRange.Font.Name);
|
|
||||||
sb.Append(sep + "'" + myRange.Font.Name + "'");
|
|
||||||
sep = ",";
|
|
||||||
}
|
|
||||||
offset = newOffset;
|
|
||||||
}
|
|
||||||
if (sb.Length > 0) return sb.ToString();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Debug Tool - Return a list of symbol characters using VESYMB font.
|
|
||||||
/// </summary>
|
|
||||||
public string FontsHaveSymbolCharacters2
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Dictionary<string, List<int>> fonts = new Dictionary<string, List<int>>();
|
|
||||||
LBRange myRange = Range();
|
|
||||||
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
|
|
||||||
myRange.Start = 0;
|
|
||||||
int end = myRange.End;
|
|
||||||
string myText = GetRangeText(myRange);
|
|
||||||
//return _RegFindSymbol.IsMatch(myText);
|
|
||||||
MatchCollection problems = _RegFindSymbol.Matches(myText);
|
|
||||||
int offset = 0;
|
|
||||||
foreach (Match problem in problems)
|
|
||||||
{
|
|
||||||
myRange.Start = problem.Index + offset;
|
|
||||||
myRange.End = problem.Index + problem.Length + offset;
|
|
||||||
int newOffset = FindRangeOffset(myRange, problem, offset, end);
|
|
||||||
string sFont = myRange.Font.Name;
|
|
||||||
if (sFont.ToUpper().StartsWith("VESYM"))
|
|
||||||
{
|
|
||||||
if (!fonts.ContainsKey(sFont))
|
|
||||||
{
|
|
||||||
fonts.Add(sFont, new List<int>());
|
|
||||||
}
|
|
||||||
List<int> symbols = fonts[sFont];
|
|
||||||
string myTextSymb = GetRangeText(myRange);
|
|
||||||
foreach (char c in myTextSymb)
|
|
||||||
{
|
|
||||||
if (!symbols.Contains((int)c))
|
|
||||||
symbols.Add((int)c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
offset = newOffset;
|
|
||||||
}
|
|
||||||
if (fonts.Count > 0)
|
|
||||||
{
|
|
||||||
string sep = "";
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
foreach (string font in fonts.Keys)
|
|
||||||
{
|
|
||||||
sb.Append(sep + "'" + font + "'");
|
|
||||||
sep = ",";
|
|
||||||
foreach (int i in fonts[font])
|
|
||||||
{
|
|
||||||
sb.Append(sep);
|
|
||||||
sb.Append(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sb.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine("{0},{1},{2}", ex.GetType().Name, ex.Message, ex.StackTrace);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks to see if the document contains symbol characters
|
/// Checks to see if the document contains symbol characters
|
||||||
@@ -601,86 +457,7 @@ namespace LBWordLibrary
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Regex _RegFindSymbol = new Regex("[\\uF020-\\uF07F]+");
|
Regex _RegFindSymbol = new Regex("[\\uF020-\\uF07F]+");
|
||||||
/// <summary>
|
|
||||||
/// FixSymbolCharacters - Fix any symbol characters in the document
|
|
||||||
/// </summary>
|
|
||||||
public void FixSymbolCharacters()
|
|
||||||
{
|
|
||||||
// Set up range object to be used to process text
|
|
||||||
LBRange myRange = Range();
|
|
||||||
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
|
|
||||||
int end = myRange.End;
|
|
||||||
myRange.Start = 0;
|
|
||||||
string myText = GetRangeText(myRange);
|
|
||||||
MatchCollection problems = _RegFindSymbol.Matches(myText);
|
|
||||||
int offset = 0;
|
|
||||||
foreach (Match problem in problems)
|
|
||||||
{
|
|
||||||
myRange.Start = problem.Index + offset;
|
|
||||||
myRange.End = problem.Index + problem.Length + offset;
|
|
||||||
int newOffset = FindRangeOffset(myRange, problem, offset, end);
|
|
||||||
if (myRange.Font.Name == "")
|
|
||||||
{
|
|
||||||
int wrdStart = myRange.Start;
|
|
||||||
int wrdEnd = myRange.End;
|
|
||||||
int wrdMiddle = wrdStart;
|
|
||||||
while (myRange.Font.Name == "")
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
myRange.End = ++wrdMiddle;
|
|
||||||
} while(myRange.Font.Name != "");
|
|
||||||
myRange.End = wrdMiddle - 1;
|
|
||||||
ReplaceSymbolCharacters(myRange);
|
|
||||||
myRange.Start = wrdMiddle -1;
|
|
||||||
myRange.End = wrdEnd;
|
|
||||||
}
|
|
||||||
ReplaceSymbolCharacters(myRange);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ReplaceSymbolCharacters(myRange);
|
|
||||||
}
|
|
||||||
offset = newOffset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Try to fix the first character in the symbol range F000 to F0FF. If it cannot be
|
|
||||||
/// fixed, it is an indicator that the font is not installed properly. Regardless of
|
|
||||||
/// whether there is success, the change is undone so that the document will not be
|
|
||||||
/// considered dirty, i.e. will not prompt user for save.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool AttemptToFixASymbolCharacter()
|
|
||||||
{
|
|
||||||
// Set up range object to be used to process text
|
|
||||||
LBRange myRange = Range();
|
|
||||||
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
|
|
||||||
|
|
||||||
int end = myRange.End;
|
|
||||||
myRange.Start = 0;
|
|
||||||
string myText = GetRangeText(myRange);
|
|
||||||
MatchCollection problems = _RegFindSymbol.Matches(myText);
|
|
||||||
if (problems.Count>0)
|
|
||||||
{
|
|
||||||
Match problem = problems[0];
|
|
||||||
myRange.Start = problem.Index;
|
|
||||||
myRange.End = myRange.Start + 1;
|
|
||||||
if (IsSymbolFont(myRange.Font.Name)) return true; // if it's a symbol font already, no issue.
|
|
||||||
string before = GetRangeText(myRange);
|
|
||||||
string updated = ReplaceSymbolCharacters(before);
|
|
||||||
myRange.Text = updated;
|
|
||||||
string after = GetRangeText(myRange);
|
|
||||||
Undo(1);
|
|
||||||
//Console.WriteLine("Undo1 results = {0}", tst);
|
|
||||||
//tst = Undo(1);
|
|
||||||
//Console.WriteLine("Undo2 results = {0}", tst);
|
|
||||||
//tst = Undo(1);
|
|
||||||
//Console.WriteLine("Undo3 results = {0}", tst);
|
|
||||||
return (updated == after);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the Range Text with error handling. myRange.Text sometimes will get a null reference exception.
|
/// Get the Range Text with error handling. myRange.Text sometimes will get a null reference exception.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -737,35 +514,6 @@ namespace LBWordLibrary
|
|||||||
return myRange.Start - problem.Index;
|
return myRange.Start - problem.Index;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ReplaceSymbolCharacters Replaces any symbol characters in the specified range
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="myRange"></param>
|
|
||||||
private static void ReplaceSymbolCharacters(LBRange myRange)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (IsSymbolFont(myRange.Font.Name))
|
|
||||||
return;
|
|
||||||
string before = GetRangeText(myRange);
|
|
||||||
string updated = ReplaceSymbolCharacters(before);
|
|
||||||
myRange.Text = updated;
|
|
||||||
string after = GetRangeText(myRange);
|
|
||||||
if (after != updated) // If the Word text doesn't match try including a character before and after and do it again.
|
|
||||||
{
|
|
||||||
Console.WriteLine("'TryEntireRange Failed',{0},{1},'{2}','{3}','{4}'", myRange.Start, myRange.End, before, updated, after);
|
|
||||||
int end = myRange.End;
|
|
||||||
myRange.Start = myRange.Start - 1;
|
|
||||||
myRange.End = end + 1;
|
|
||||||
myRange.Text = ReplaceSymbolCharacters(GetRangeText(myRange));
|
|
||||||
Console.WriteLine("'TryEntireRange Failed',{0},{1},'{2}'", myRange.Start, myRange.End, GetRangeText(myRange));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine("'TryEntireRange Exception',{0},{1},'{2}'", myRange.Start, myRange.End, ex.Message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// ReplaceSymbolCharacters processes the string returned and changes any symbols (0xF0??) to normal characters
|
/// ReplaceSymbolCharacters processes the string returned and changes any symbols (0xF0??) to normal characters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="str"></param>
|
/// <param name="str"></param>
|
||||||
|
|||||||
@@ -418,7 +418,7 @@ namespace ROEditor
|
|||||||
// NOTE: not doing the "Using System.Threading;" statement at beginning of file because it conflicts with the declaration of the "Timer" variable
|
// NOTE: not doing the "Using System.Threading;" statement at beginning of file because it conflicts with the declaration of the "Timer" variable
|
||||||
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
|
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
|
||||||
|
|
||||||
// The data path the was passed in.
|
// The data path the was passed in.
|
||||||
DbConnectPath = PassedInPath;
|
DbConnectPath = PassedInPath;
|
||||||
|
|
||||||
// Setup the context menu
|
// Setup the context menu
|
||||||
@@ -2844,7 +2844,8 @@ namespace ROEditor
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newt=null;
|
mnutitle = Regex.Replace(mnutitle, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022
|
||||||
|
newt =null;
|
||||||
success = myrodb.RODB_WriteRO((VlnXmlElement)roTreeView.SelectedNode.Tag);
|
success = myrodb.RODB_WriteRO((VlnXmlElement)roTreeView.SelectedNode.Tag);
|
||||||
if (success==true && mnutitle != "") roTreeView.SelectedNode.Text = mnutitle; //B2021-077 make sure mnutitle has text or it will clear the node's title in the tree
|
if (success==true && mnutitle != "") roTreeView.SelectedNode.Text = mnutitle; //B2021-077 make sure mnutitle has text or it will clear the node's title in the tree
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,147 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||||
|
Copyright 2026 - Volian Enterprises, Inc. All rights reserved.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
-- =============================================
|
||||||
|
-- Author: Matthew Schill
|
||||||
|
-- Create date: 03/20/2026
|
||||||
|
-- Description: Script to consolidate Cover Pages for Barakah
|
||||||
|
-- by Converting multi-unit procedures with Cover Pages
|
||||||
|
-- to use 1 Library Document Cover Page
|
||||||
|
-- =============================================
|
||||||
|
|
||||||
|
select Contents.ContentID
|
||||||
|
, Contenttext = Contents.Text
|
||||||
|
, Items.ItemID
|
||||||
|
, tblDocuments.DocID
|
||||||
|
, ParentContentID
|
||||||
|
, ParentItemID
|
||||||
|
, LibTitle = ISNULL(LibTitle,'')
|
||||||
|
, numLibCP
|
||||||
|
, numCP
|
||||||
|
,BaseFlag = 0
|
||||||
|
INTO #tmpUpdate
|
||||||
|
from Contents
|
||||||
|
inner join Entries on Contents.ContentID = Entries.ContentID
|
||||||
|
inner join tblDocuments on tblDocuments.DocID = Entries.DocID
|
||||||
|
inner join Items on Items.ContentID = Contents.ContentID
|
||||||
|
outer apply
|
||||||
|
(select ParentContentID=ContentID, ParentItemID = PItm.ItemID
|
||||||
|
FROM dbo.vefn_ParentItems(Items.ItemID) PItm
|
||||||
|
where PItm.ItemID <> Items.ItemID
|
||||||
|
) parent
|
||||||
|
outer apply
|
||||||
|
(select numLibCP = Count(*)
|
||||||
|
FROM dbo.vefn_ChildItems(ParentItemID) PItm
|
||||||
|
INNER JOIN Contents on Contents.ContentID = PItm.ContentID
|
||||||
|
INNER JOIN Entries on Contents.ContentID = Entries.ContentID
|
||||||
|
INNER JOIN tblDocuments on tblDocuments.DocID = Entries.DocID
|
||||||
|
where PItm.ItemID <> ParentItemID
|
||||||
|
AND Contents.text like 'Cover Page%' and ISNULL(tblDocuments.LibTitle,'') <> ''
|
||||||
|
) childWithLibTitle
|
||||||
|
outer apply
|
||||||
|
(select numCP = Count(*)
|
||||||
|
FROM dbo.vefn_ChildItems(ParentItemID) PItm
|
||||||
|
INNER JOIN Contents on Contents.ContentID = PItm.ContentID
|
||||||
|
where PItm.ItemID <> ParentItemID
|
||||||
|
AND Contents.text like 'Cover Page%'
|
||||||
|
) child
|
||||||
|
where Contents.text like 'Cover Page%'
|
||||||
|
order by ParentContentID asc, CASE WHEN ISNULL(LibTitle,'') <> '' THEN 1 ELSE 2 END asc, Contents.Text asc
|
||||||
|
|
||||||
|
UPDATE #tmpUpdate SET BaseFlag = 1 where LibTitle <> '' and numLibCP = 1
|
||||||
|
|
||||||
|
UPDATE #tmpUpdate SET BaseFlag = CASE WHEN tU.LibTitle <> '' THEN 1 ELSE 2 END FROM #tmpUpdate tU
|
||||||
|
where BaseFlag = 0 AND tU.ContentID IN
|
||||||
|
(
|
||||||
|
Select ContentID FROM
|
||||||
|
(SELECT sub.ContentID,
|
||||||
|
row_number() OVER(PARTITION BY sub.ParentContentID ORDER BY CASE WHEN ISNULL(sub.LibTitle,'') <> '' THEN 1 ELSE 2 END asc, sub.Contenttext asc) as pos
|
||||||
|
FROM #tmpUpdate sub
|
||||||
|
) x
|
||||||
|
WHERE x.pos = 1
|
||||||
|
)
|
||||||
|
|
||||||
|
declare @Cont TABLE
|
||||||
|
(
|
||||||
|
ContentID int,
|
||||||
|
ItemID int,
|
||||||
|
xConfig xml
|
||||||
|
)
|
||||||
|
insert into @Cont
|
||||||
|
SELECT tU.ContentID, ItemID, xConfig = CAST(tblContents.config AS xml) FROM
|
||||||
|
tblContents
|
||||||
|
INNER JOIN
|
||||||
|
#tmpUpdate tU ON tU.ContentID = tblContents.ContentID
|
||||||
|
where tU.BaseFlag > 0
|
||||||
|
|
||||||
|
Update @Cont Set xConfig.modify('delete //MasterSlave') From @Cont;
|
||||||
|
|
||||||
|
Update tblContents SET Text = 'Cover Page', Config = CAST(xConfig AS varchar(max)),
|
||||||
|
DTS = GETDATE(), UserID = 'CPVolian2026'
|
||||||
|
FROM
|
||||||
|
@Cont CNT INNER JOIN
|
||||||
|
tblContents ON CNT.ContentID = tblContents.ContentID;
|
||||||
|
|
||||||
|
--Update items PreviousIds
|
||||||
|
UPDATE tblItems Set PreviousID = IdToSwapTO.ItemID
|
||||||
|
FROM
|
||||||
|
tblItems
|
||||||
|
INNER JOIN
|
||||||
|
#tmpUpdate tU ON tblItems.PreviousID = tU.ItemID AND tU.BaseFlag = 0
|
||||||
|
INNER JOIN #tmpUpdate IdToSwapTO ON IdToSwapTO.ParentContentID = tU.ParentContentID AND IdToSwapTO.BaseFlag IN (1,2)
|
||||||
|
|
||||||
|
UPDATE tblItems Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026'
|
||||||
|
FROM
|
||||||
|
#tmpUpdate tU INNER JOIN
|
||||||
|
tblItems ON tU.ContentID = tblItems.ContentID
|
||||||
|
WHERE tU.BaseFlag = 0;
|
||||||
|
|
||||||
|
UPDATE tblContents Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026'
|
||||||
|
FROM
|
||||||
|
#tmpUpdate tU INNER JOIN
|
||||||
|
tblContents ON tU.ContentID = tblContents.ContentID
|
||||||
|
WHERE tU.BaseFlag = 0;
|
||||||
|
|
||||||
|
DELETE FROM
|
||||||
|
tblEntries
|
||||||
|
FROM
|
||||||
|
tblEntries
|
||||||
|
INNER JOIN
|
||||||
|
#tmpUpdate tU ON tU.ContentID = tblEntries.ContentID
|
||||||
|
WHERE tU.BaseFlag in (0,2);
|
||||||
|
|
||||||
|
INSERT INTO [dbo].[tblEntries]
|
||||||
|
([ContentID]
|
||||||
|
,[DocID]
|
||||||
|
,[DTS]
|
||||||
|
,[UserID]
|
||||||
|
,[DeleteStatus])
|
||||||
|
SELECT
|
||||||
|
DISTINCT tU.ContentID,
|
||||||
|
766, -- docid 766 "Cover Page 1"
|
||||||
|
GETDATE(),
|
||||||
|
'CPVolian2026',
|
||||||
|
0
|
||||||
|
FROM
|
||||||
|
#tmpUpdate tU
|
||||||
|
INNER JOIN
|
||||||
|
@Cont CNT ON tU.ContentID = CNT.ContentID
|
||||||
|
WHERE tU.BaseFlag = 2;
|
||||||
|
|
||||||
|
drop table #tmpUpdate;
|
||||||
|
|
||||||
|
IF (@@Error = 0) SELECT '[Barakah Cover Page Consolidation] Succeeded'
|
||||||
|
ELSE SELECT '[Barakah Cover Page Consolidation] Error'
|
||||||
|
go
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,263 @@
|
|||||||
|
|
||||||
|
-- =============================================
|
||||||
|
-- Author: Matthew Schill
|
||||||
|
-- Create date: 03/20/2026
|
||||||
|
-- Description: Script to consolidate Cover Pages for Barakah
|
||||||
|
-- by Converting multi-unit procedures with Cover Pages
|
||||||
|
-- to use 1 Library Document Cover Page
|
||||||
|
-- =============================================
|
||||||
|
|
||||||
|
----@isTest = 0 will change data
|
||||||
|
----@isTest = 1 for internal testing (no data will be changed)
|
||||||
|
DECLARE @isTest bit = 1;
|
||||||
|
|
||||||
|
----Per Cover Page, pull how many cover pages
|
||||||
|
----Each Cover Page's procedure has
|
||||||
|
----and how many of those are library documents
|
||||||
|
select Contents.ContentID
|
||||||
|
, Contenttext = Contents.Text
|
||||||
|
, Items.ItemID
|
||||||
|
, tblDocuments.DocID
|
||||||
|
, ParentContentID
|
||||||
|
, ParentItemID
|
||||||
|
, LibTitle = ISNULL(LibTitle,'')
|
||||||
|
, numLibCP
|
||||||
|
, numCP
|
||||||
|
,BaseFlag = 0
|
||||||
|
INTO #tmpUpdate
|
||||||
|
from Contents
|
||||||
|
inner join Entries on Contents.ContentID = Entries.ContentID
|
||||||
|
inner join tblDocuments on tblDocuments.DocID = Entries.DocID
|
||||||
|
inner join Items on Items.ContentID = Contents.ContentID
|
||||||
|
outer apply
|
||||||
|
(select ParentContentID=ContentID, ParentItemID = PItm.ItemID
|
||||||
|
FROM dbo.vefn_ParentItems(Items.ItemID) PItm
|
||||||
|
where PItm.ItemID <> Items.ItemID
|
||||||
|
) parent
|
||||||
|
outer apply
|
||||||
|
(select numLibCP = Count(*)
|
||||||
|
FROM dbo.vefn_ChildItems(ParentItemID) PItm
|
||||||
|
INNER JOIN Contents on Contents.ContentID = PItm.ContentID
|
||||||
|
INNER JOIN Entries on Contents.ContentID = Entries.ContentID
|
||||||
|
INNER JOIN tblDocuments on tblDocuments.DocID = Entries.DocID
|
||||||
|
where PItm.ItemID <> ParentItemID
|
||||||
|
AND Contents.text like 'Cover Page%' and ISNULL(tblDocuments.LibTitle,'') <> ''
|
||||||
|
) childWithLibTitle
|
||||||
|
outer apply
|
||||||
|
(select numCP = Count(*)
|
||||||
|
FROM dbo.vefn_ChildItems(ParentItemID) PItm
|
||||||
|
INNER JOIN Contents on Contents.ContentID = PItm.ContentID
|
||||||
|
where PItm.ItemID <> ParentItemID
|
||||||
|
AND Contents.text like 'Cover Page%'
|
||||||
|
) child
|
||||||
|
where Contents.text like 'Cover Page%'
|
||||||
|
order by ParentContentID asc, CASE WHEN ISNULL(LibTitle,'') <> '' THEN 1 ELSE 2 END asc, Contents.Text asc
|
||||||
|
|
||||||
|
--BaseFlag
|
||||||
|
-- 0 = a Cover Page that will be deleted
|
||||||
|
-- 1 = is base item (Cover Page will get renamed and applicability set to all)
|
||||||
|
-- 2 = would be base item but not linked to Lib document (Cover Page will get renamed and applicability set to all + will need linked to library doc)
|
||||||
|
|
||||||
|
---- If only 1 Library Doc CP for the CP's procedure and this is it, then mark this CP as the one we will keep
|
||||||
|
UPDATE #tmpUpdate SET BaseFlag = 1 where LibTitle <> '' and numLibCP = 1
|
||||||
|
|
||||||
|
---- If multiple Library Document CPs, pick the first one as the one we will keep (BaseFlag = 1)
|
||||||
|
---- If no Library Document CPs, pick the first one as the one we will repurpose (BaseFlag = 2)
|
||||||
|
UPDATE #tmpUpdate SET BaseFlag = CASE WHEN tU.LibTitle <> '' THEN 1 ELSE 2 END FROM #tmpUpdate tU
|
||||||
|
where BaseFlag = 0 AND tU.ContentID IN
|
||||||
|
(
|
||||||
|
Select ContentID FROM
|
||||||
|
(SELECT sub.ContentID,
|
||||||
|
row_number() OVER(PARTITION BY sub.ParentContentID ORDER BY CASE WHEN ISNULL(sub.LibTitle,'') <> '' THEN 1 ELSE 2 END asc, sub.Contenttext asc) as pos
|
||||||
|
FROM #tmpUpdate sub
|
||||||
|
) x
|
||||||
|
WHERE x.pos = 1
|
||||||
|
)
|
||||||
|
|
||||||
|
----BEGIN TESTS--
|
||||||
|
if(@isTest = 1)
|
||||||
|
BEGIN
|
||||||
|
select Count(*), 'Should be Zero - not exactly one BaseFlag set to non 0 for each Parent Item' FROM #tmpUpdate TU
|
||||||
|
OUTER APPLY
|
||||||
|
(select numBaseFlagSet = SUM(CASE WHEN sub.BaseFlag > 0 THEN 1 ELSE 0 END)
|
||||||
|
FROM #tmpUpdate sub
|
||||||
|
where sub.ParentContentID = TU.ParentContentID
|
||||||
|
) sub
|
||||||
|
where numBaseFlagSet <> 1
|
||||||
|
|
||||||
|
select Count(*), 'Should be Zero - 0 Lib Docs, BaseFlag is 1' FROM #tmpUpdate TU
|
||||||
|
where numLibCP = 0 and BaseFlag = 1
|
||||||
|
|
||||||
|
select Count(*), 'Should be Zero - at least 1 Lib Docs, BaseFlag is 2' FROM #tmpUpdate TU
|
||||||
|
where numLibCP > 0 and BaseFlag = 2
|
||||||
|
|
||||||
|
select Count(*), 'Should be Zero - 1 Lib Docs, BaseFlag not 1 for that Lib doc' FROM #tmpUpdate TU
|
||||||
|
where numLibCP = 1 and LibTitle <> '' and BaseFlag <> 1
|
||||||
|
|
||||||
|
select Count(*), 'Should be Zero - 1 Lib Docs, BaseFlag not 0 for ones without Lib Doc' FROM #tmpUpdate TU
|
||||||
|
where numLibCP = 1 and LibTitle = '' and BaseFlag <> 0
|
||||||
|
|
||||||
|
select Count(*), 'Should be Zero - 1 CP, no Lib Docs, BaseFlag not 2' FROM #tmpUpdate TU
|
||||||
|
where numLibCP = 0 and numCP = 1 and BaseFlag <> 2
|
||||||
|
|
||||||
|
select Count(*), 'Should be Zero - more than 1 Lib Docs, BaseFlag is 1' FROM #tmpUpdate TU
|
||||||
|
where numLibCP = 0 and BaseFlag = 1
|
||||||
|
|
||||||
|
select Count(*), 'Should be Zero - not exactly one BaseFlag set to non 0 for each Parent Item' FROM #tmpUpdate TU
|
||||||
|
OUTER APPLY
|
||||||
|
(select numBaseFlagSet = SUM(CASE WHEN sub.BaseFlag > 0 THEN 1 ELSE 0 END)
|
||||||
|
FROM #tmpUpdate sub
|
||||||
|
where sub.ParentContentID = TU.ParentContentID
|
||||||
|
) sub
|
||||||
|
where numBaseFlagSet <> 1
|
||||||
|
|
||||||
|
select Count(*), 'Should be Zero - 0 Lib Docs, BaseFlag is 1' FROM #tmpUpdate TU
|
||||||
|
where numLibCP = 0
|
||||||
|
and BaseFlag = 1
|
||||||
|
|
||||||
|
--all Parents should have exactly 1 Baseflag=1 or BaseFlage = 2
|
||||||
|
select 'Should be No Records where not a BaseFlag 1 or 2'
|
||||||
|
select NumNotBaseFlag12 = Count(*)
|
||||||
|
FROM #tmpUpdate TU
|
||||||
|
Group by ParentContentID
|
||||||
|
HAVING SUM(CASE WHEN BaseFlag in (1,2) THEN 1 ELSE 0 END) <> 1
|
||||||
|
|
||||||
|
select 'Should be No Records where with both a BaseFlag 1 and 2'
|
||||||
|
select NumBothBaseFlag12 = Count(*)
|
||||||
|
FROM #tmpUpdate TU
|
||||||
|
Group by ParentContentID
|
||||||
|
HAVING SUM(BaseFlag) > 2
|
||||||
|
|
||||||
|
END
|
||||||
|
--END TESTS--
|
||||||
|
|
||||||
|
--BaseFlag
|
||||||
|
-- 0 = a Cover Page that will be deleted
|
||||||
|
-- 1 = is base item (Cover Page will get renamed and applicability set to all)
|
||||||
|
-- 2 = would be base item but not linked to Lib document (Cover Page will get renamed and applicability set to all + will need linked to library doc)
|
||||||
|
|
||||||
|
----Update config for Coverpage 1 to remove <MasterSlave Applicability="1" />
|
||||||
|
----from that config
|
||||||
|
----cover page 1s
|
||||||
|
declare @Cont TABLE
|
||||||
|
(
|
||||||
|
ContentID int,
|
||||||
|
ItemID int,
|
||||||
|
xConfig xml
|
||||||
|
)
|
||||||
|
insert into @Cont
|
||||||
|
SELECT tU.ContentID, ItemID, xConfig = CAST(tblContents.config AS xml) FROM
|
||||||
|
tblContents
|
||||||
|
INNER JOIN
|
||||||
|
#tmpUpdate tU ON tU.ContentID = tblContents.ContentID
|
||||||
|
where tU.BaseFlag > 0
|
||||||
|
|
||||||
|
if(@isTest = 1)
|
||||||
|
BEGIN
|
||||||
|
select WRD='Have Masterslave in xconfig', NumwithMasterSlave = Count(*) FROM @Cont CNT
|
||||||
|
INNER JOIN
|
||||||
|
tblContents ON CNT.ContentID = tblContents.ContentID
|
||||||
|
where CAST(xConfig AS varchar(max)) like '%MasterSlave%'
|
||||||
|
END
|
||||||
|
|
||||||
|
Update @Cont Set xConfig.modify('delete //MasterSlave') From @Cont;
|
||||||
|
|
||||||
|
if(@isTest = 1)
|
||||||
|
BEGIN
|
||||||
|
select WRD='None should have Masterslave Removed in xconfig', NumwithMasterSlave = Count(*) FROM @Cont CNT
|
||||||
|
INNER JOIN
|
||||||
|
tblContents ON CNT.ContentID = tblContents.ContentID
|
||||||
|
where CAST(xConfig AS varchar(max)) like '%MasterSlave%'
|
||||||
|
|
||||||
|
select 'Show Records and how the ids will be re-linked'
|
||||||
|
|
||||||
|
Select tblItems.ItemID, tblItems.ContentID, tblItems.PreviousID, tblContents.Text,
|
||||||
|
PreviousItemID = tU.ItemID, PreviousContentID = tU.ContentID, PreviousText = tUCont.Text,
|
||||||
|
RelinkToItemID = IdToSwapTO.ItemID, RelinkToContentID = IdToSwapTO.ContentID, RelinkToText = IdToSwapTOCont.Text
|
||||||
|
FROM
|
||||||
|
tblItems
|
||||||
|
INNER JOIN
|
||||||
|
tblContents on tblContents.ContentID = tblItems.ContentID
|
||||||
|
INNER JOIN
|
||||||
|
#tmpUpdate tU ON tblItems.PreviousID = tU.ItemID AND tU.BaseFlag = 0
|
||||||
|
INNER JOIN
|
||||||
|
tblContents tUCont on tUCont.ContentID = tU.ContentID
|
||||||
|
LEFT OUTER JOIN #tmpUpdate IdToSwapTO ON IdToSwapTO.ParentContentID = tU.ParentContentID AND IdToSwapTO.BaseFlag IN (1,2)
|
||||||
|
LEFT OUTER JOIN tblContents IdToSwapTOCont on IdToSwapTOCont.ContentID = IdToSwapTO.ContentID
|
||||||
|
|
||||||
|
END
|
||||||
|
ELSE
|
||||||
|
BEGIN
|
||||||
|
--Update Config for Contents and set Text = 'Cover Page'
|
||||||
|
Update tblContents SET Text = 'Cover Page', Config = CAST(xConfig AS varchar(max)),
|
||||||
|
DTS = GETDATE(), UserID = 'CPVolian2026'
|
||||||
|
FROM
|
||||||
|
@Cont CNT INNER JOIN
|
||||||
|
tblContents ON CNT.ContentID = tblContents.ContentID;
|
||||||
|
|
||||||
|
--Update items PreviousIds
|
||||||
|
UPDATE tblItems Set PreviousID = IdToSwapTO.ItemID
|
||||||
|
FROM
|
||||||
|
tblItems
|
||||||
|
INNER JOIN
|
||||||
|
#tmpUpdate tU ON tblItems.PreviousID = tU.ItemID AND tU.BaseFlag = 0
|
||||||
|
INNER JOIN #tmpUpdate IdToSwapTO ON IdToSwapTO.ParentContentID = tU.ParentContentID AND IdToSwapTO.BaseFlag IN (1,2)
|
||||||
|
|
||||||
|
--delete where BaseFlag = 0 ---Items,Content,Entries, --set DeleteStatus = 1
|
||||||
|
--these are ones that will be replaced by a library document
|
||||||
|
UPDATE tblItems Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026'
|
||||||
|
FROM
|
||||||
|
#tmpUpdate tU INNER JOIN
|
||||||
|
tblItems ON tU.ContentID = tblItems.ContentID
|
||||||
|
WHERE tU.BaseFlag = 0;
|
||||||
|
|
||||||
|
UPDATE tblContents Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026'
|
||||||
|
FROM
|
||||||
|
#tmpUpdate tU INNER JOIN
|
||||||
|
tblContents ON tU.ContentID = tblContents.ContentID
|
||||||
|
WHERE tU.BaseFlag = 0;
|
||||||
|
|
||||||
|
--delete entries where Baseflag = 2
|
||||||
|
--create new entries where Baseflag = 2
|
||||||
|
|
||||||
|
DELETE FROM
|
||||||
|
tblEntries
|
||||||
|
FROM
|
||||||
|
tblEntries
|
||||||
|
INNER JOIN
|
||||||
|
#tmpUpdate tU ON tU.ContentID = tblEntries.ContentID
|
||||||
|
WHERE tU.BaseFlag in (0,2);
|
||||||
|
|
||||||
|
INSERT INTO [dbo].[tblEntries]
|
||||||
|
([ContentID]
|
||||||
|
,[DocID]
|
||||||
|
,[DTS]
|
||||||
|
,[UserID]
|
||||||
|
,[DeleteStatus])
|
||||||
|
SELECT
|
||||||
|
DISTINCT tU.ContentID,
|
||||||
|
766, -- docid 766 "Cover Page 1"
|
||||||
|
GETDATE(),
|
||||||
|
'CPVolian2026',
|
||||||
|
0
|
||||||
|
FROM
|
||||||
|
#tmpUpdate tU
|
||||||
|
INNER JOIN
|
||||||
|
@Cont CNT ON tU.ContentID = CNT.ContentID
|
||||||
|
WHERE tU.BaseFlag = 2;
|
||||||
|
|
||||||
|
END;
|
||||||
|
|
||||||
|
drop table #tmpUpdate;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -24753,7 +24753,7 @@ BEGIN
|
|||||||
select Docs.DocID, UnitID, SectionID = MIN(SectionID)
|
select Docs.DocID, UnitID, SectionID = MIN(SectionID)
|
||||||
FROM
|
FROM
|
||||||
(SELECT DISTINCT [DocID]
|
(SELECT DISTINCT [DocID]
|
||||||
FROM [VEPROMS_Barakah].[dbo].[tblDocuments]) Docs
|
FROM [tblDocuments]) Docs
|
||||||
INNER JOIN Entries on Docs.DocID = Entries.DocID
|
INNER JOIN Entries on Docs.DocID = Entries.DocID
|
||||||
INNER JOIN Contents on Entries.ContentID = Contents.ContentID
|
INNER JOIN Contents on Entries.ContentID = Contents.ContentID
|
||||||
inner join Items on Items.ContentID = Contents.ContentID
|
inner join Items on Items.ContentID = Contents.ContentID
|
||||||
|
|||||||
@@ -947,14 +947,16 @@ namespace VEPROMS
|
|||||||
pi = AddProcedure(xd.DocumentElement, dvi, pi);
|
pi = AddProcedure(xd.DocumentElement, dvi, pi);
|
||||||
GC.Collect(); // need to cleanup memory after importing each procedure due to use of Regular Expressions in processing RO and Transition links
|
GC.Collect(); // need to cleanup memory after importing each procedure due to use of Regular Expressions in processing RO and Transition links
|
||||||
}
|
}
|
||||||
DirectoryInfo di = new DirectoryInfo(PEIPath);
|
|
||||||
DirectoryInfo[] dis = di.GetDirectories();
|
|
||||||
for (int d = 0; d < dis.Length; d++)
|
|
||||||
dis[d].Delete(true);
|
|
||||||
lblImportStatus.Text = "Updating Transitions";
|
lblImportStatus.Text = "Updating Transitions";
|
||||||
AddTransitions();
|
AddTransitions();
|
||||||
FixFloatingFoldouts();
|
FixFloatingFoldouts();
|
||||||
SaveTransitionAndItemContentIDs();
|
SaveTransitionAndItemContentIDs();
|
||||||
|
// B2026-034 remove the folders created from un-ziping the import set file - this was done prior to updating transitions
|
||||||
|
// so if there was an issue deleting these temporay folders and files, the actual importing will be completed
|
||||||
|
DirectoryInfo di = new DirectoryInfo(PEIPath);
|
||||||
|
DirectoryInfo[] dis = di.GetDirectories();
|
||||||
|
for (int d = 0; d < dis.Length; d++)
|
||||||
|
dis[d].Delete(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1322,6 +1322,7 @@
|
|||||||
this.swRegenWordAttmts.TabIndex = 34;
|
this.swRegenWordAttmts.TabIndex = 34;
|
||||||
this.swRegenWordAttmts.Value = true;
|
this.swRegenWordAttmts.Value = true;
|
||||||
this.swRegenWordAttmts.ValueObject = "Y";
|
this.swRegenWordAttmts.ValueObject = "Y";
|
||||||
|
this.swRegenWordAttmts.ValueChanged += new System.EventHandler(this.swCk_ValueChanged);
|
||||||
//
|
//
|
||||||
// labelX1
|
// labelX1
|
||||||
//
|
//
|
||||||
|
|||||||
+1
-12
@@ -83,7 +83,6 @@ namespace VEPROMS
|
|||||||
this.lblUser = new DevComponents.DotNetBar.LabelItem();
|
this.lblUser = new DevComponents.DotNetBar.LabelItem();
|
||||||
this.lblLastChange = new DevComponents.DotNetBar.LabelItem();
|
this.lblLastChange = new DevComponents.DotNetBar.LabelItem();
|
||||||
this.btnStepRTF = new DevComponents.DotNetBar.ButtonItem();
|
this.btnStepRTF = new DevComponents.DotNetBar.ButtonItem();
|
||||||
this.btnFixMSWord = new DevComponents.DotNetBar.ButtonItem();
|
|
||||||
this.epAnnotations = new DevComponents.DotNetBar.ExpandablePanel();
|
this.epAnnotations = new DevComponents.DotNetBar.ExpandablePanel();
|
||||||
this.ctrlAnnotationDetails = new Volian.Controls.Library.AnnotationDetails();
|
this.ctrlAnnotationDetails = new Volian.Controls.Library.AnnotationDetails();
|
||||||
this.btnAnnoDetailsPushPin = new DevComponents.DotNetBar.ButtonX();
|
this.btnAnnoDetailsPushPin = new DevComponents.DotNetBar.ButtonX();
|
||||||
@@ -541,8 +540,7 @@ namespace VEPROMS
|
|||||||
this.btnEditItem,
|
this.btnEditItem,
|
||||||
this.lblUser,
|
this.lblUser,
|
||||||
this.lblLastChange,
|
this.lblLastChange,
|
||||||
this.btnStepRTF,
|
this.btnStepRTF});
|
||||||
this.btnFixMSWord});
|
|
||||||
this.bottomBar.Location = new System.Drawing.Point(5, 573);
|
this.bottomBar.Location = new System.Drawing.Point(5, 573);
|
||||||
this.bottomBar.Name = "bottomBar";
|
this.bottomBar.Name = "bottomBar";
|
||||||
this.bottomBar.Size = new System.Drawing.Size(1185, 25);
|
this.bottomBar.Size = new System.Drawing.Size(1185, 25);
|
||||||
@@ -728,14 +726,6 @@ namespace VEPROMS
|
|||||||
this.btnStepRTF.Text = "Step RTF";
|
this.btnStepRTF.Text = "Step RTF";
|
||||||
this.btnStepRTF.Click += new System.EventHandler(this.btnStepRTF_Click);
|
this.btnStepRTF.Click += new System.EventHandler(this.btnStepRTF_Click);
|
||||||
//
|
//
|
||||||
// btnFixMSWord
|
|
||||||
//
|
|
||||||
this.btnFixMSWord.ForeColor = System.Drawing.Color.Black;
|
|
||||||
this.btnFixMSWord.Name = "btnFixMSWord";
|
|
||||||
this.btnFixMSWord.Text = "Fix Symbol Fonts";
|
|
||||||
this.btnFixMSWord.Visible = false;
|
|
||||||
this.btnFixMSWord.Click += new System.EventHandler(this.btnFixMSWord_Click);
|
|
||||||
//
|
|
||||||
// epAnnotations
|
// epAnnotations
|
||||||
//
|
//
|
||||||
this.epAnnotations.CanvasColor = System.Drawing.SystemColors.Control;
|
this.epAnnotations.CanvasColor = System.Drawing.SystemColors.Control;
|
||||||
@@ -1775,7 +1765,6 @@ namespace VEPROMS
|
|||||||
private DevComponents.DotNetBar.ButtonItem btnItemInfo;
|
private DevComponents.DotNetBar.ButtonItem btnItemInfo;
|
||||||
private DevComponents.DotNetBar.ButtonItem btnFilter;
|
private DevComponents.DotNetBar.ButtonItem btnFilter;
|
||||||
private DevComponents.DotNetBar.TextBoxItem txtFilter;
|
private DevComponents.DotNetBar.TextBoxItem txtFilter;
|
||||||
private DevComponents.DotNetBar.ButtonItem btnFixMSWord;
|
|
||||||
private Volian.Controls.Library.DisplayBookMarks displayBookMarks;
|
private Volian.Controls.Library.DisplayBookMarks displayBookMarks;
|
||||||
//private DevComponents.DotNetBar.LabelItem lblLocked;
|
//private DevComponents.DotNetBar.LabelItem lblLocked;
|
||||||
private DevComponents.DotNetBar.ButtonItem btnShortCuts;
|
private DevComponents.DotNetBar.ButtonItem btnShortCuts;
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ namespace VEPROMS
|
|||||||
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
|
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
|
||||||
displayRO.TabControl = tc; // B2019-043 this was being passed in as a parameter for DisplayRO which caused issues with the Visual Studio designer
|
displayRO.TabControl = tc; // B2019-043 this was being passed in as a parameter for DisplayRO which caused issues with the Visual Studio designer
|
||||||
|
|
||||||
SetupFolder(MyDocVersion.FolderID);
|
SetupFolder(MyDocVersion.FolderID);
|
||||||
tc.MySessionInfo = MyParent.MySessionInfo;
|
tc.MySessionInfo = MyParent.MySessionInfo;
|
||||||
displaySearch1.TopFolderID = myDocVersion.FolderID;
|
displaySearch1.TopFolderID = myDocVersion.FolderID;
|
||||||
SelectedDVI = myDocVersion;
|
SelectedDVI = myDocVersion;
|
||||||
@@ -1578,13 +1578,13 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SelectedROFst = myDTP.MyDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
SelectedROFst = myDTP.MyDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (tc.MyEditItem != null && displayRO.MyROFST != null && tc.MyEditItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].ROFstID != displayRO.MyROFST.ROFstID)
|
else if (tc.MyEditItem != null && displayRO.MyROFST != null && tc.MyEditItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].ROFstID != displayRO.MyROFST.ROFstID)
|
||||||
{
|
{
|
||||||
SelectedROFst = tc.MyEditItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
SelectedROFst = tc.MyEditItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||||
}
|
}
|
||||||
|
|
||||||
// need this to update RO Tree after UpdateRofst (B2015-226)
|
// need this to update RO Tree after UpdateRofst (B2015-226)
|
||||||
@@ -1592,9 +1592,9 @@ namespace VEPROMS
|
|||||||
if (displayRO.MyROFST != SelectedROFst)
|
if (displayRO.MyROFST != SelectedROFst)
|
||||||
{
|
{
|
||||||
displayRO.MyROFST = SelectedROFst;
|
displayRO.MyROFST = SelectedROFst;
|
||||||
// B2023-021: force Load of Step Prop/RO panel RO tree by passing in
|
// B2023-021: force Load of Step Prop/RO panel RO tree by passing in
|
||||||
// true to LoadTree
|
// true to LoadTree
|
||||||
displayRO.LoadTree(true);
|
displayRO.LoadTree(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2396,8 +2396,8 @@ namespace VEPROMS
|
|||||||
tv.MyUserInfo = MyUserInfo;
|
tv.MyUserInfo = MyUserInfo;
|
||||||
StepTabRibbon.MySessionInfo = MySessionInfo;
|
StepTabRibbon.MySessionInfo = MySessionInfo;
|
||||||
|
|
||||||
// Initialize Caption with Server name and Database name.
|
// Initialize Caption with Server name and Database name.
|
||||||
SetCaption(tv.TopNode as VETreeNode);
|
SetCaption(tv.TopNode as VETreeNode);
|
||||||
System.Threading.AutoResetEvent autoEvent = new System.Threading.AutoResetEvent(false);
|
System.Threading.AutoResetEvent autoEvent = new System.Threading.AutoResetEvent(false);
|
||||||
|
|
||||||
//System.Threading.TimerCallback timerDelegate = new System.Threading.TimerCallback(MySessionInfo.PingSession);
|
//System.Threading.TimerCallback timerDelegate = new System.Threading.TimerCallback(MySessionInfo.PingSession);
|
||||||
@@ -4552,8 +4552,8 @@ namespace VEPROMS
|
|||||||
|
|
||||||
SetCaption(tv.SelectedNode as VETreeNode);
|
SetCaption(tv.SelectedNode as VETreeNode);
|
||||||
displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem;
|
displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem;
|
||||||
|
|
||||||
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
|
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
|
||||||
{
|
{
|
||||||
displayRO.MyROFST = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
displayRO.MyROFST = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||||
}
|
}
|
||||||
@@ -4628,8 +4628,6 @@ namespace VEPROMS
|
|||||||
if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus)
|
if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
btnFixMSWord.Visible = (args != null && (args.MyItemInfo != null && args.MyEditItem == null));
|
|
||||||
|
|
||||||
if (_LastStepRTB != null && !_LastStepRTB.Disposing && !_LastStepRTB.Closed)
|
if (_LastStepRTB != null && !_LastStepRTB.Disposing && !_LastStepRTB.Closed)
|
||||||
_LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged);
|
_LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged);
|
||||||
|
|
||||||
@@ -4767,9 +4765,9 @@ namespace VEPROMS
|
|||||||
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
||||||
displayRO.ProgressBar = bottomProgBar;
|
displayRO.ProgressBar = bottomProgBar;
|
||||||
displayRO.MyRTB = args.MyEditItem.MyStepRTB;
|
displayRO.MyRTB = args.MyEditItem.MyStepRTB;
|
||||||
displayRO.LoadTree();
|
displayRO.LoadTree();
|
||||||
|
|
||||||
displayBookMarks.MyEditItem = args.MyEditItem;
|
displayBookMarks.MyEditItem = args.MyEditItem;
|
||||||
displayHistory.MyEditItem = args.MyEditItem;
|
displayHistory.MyEditItem = args.MyEditItem;
|
||||||
|
|
||||||
lblEditView.Text = args.MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? "Edit" : "View";
|
lblEditView.Text = args.MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? "Edit" : "View";
|
||||||
@@ -4932,7 +4930,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
||||||
displayRO.LoadTree();
|
displayRO.LoadTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -5241,19 +5239,6 @@ namespace VEPROMS
|
|||||||
Clipboard.SetDataObject(mydo);
|
Clipboard.SetDataObject(mydo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void btnFixMSWord_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyDSOTabPanel != null)
|
|
||||||
{
|
|
||||||
string btnText = btnFixMSWord.Text;
|
|
||||||
btnFixMSWord.FixedSize = btnFixMSWord.Size;
|
|
||||||
btnFixMSWord.Text = "Processing ...";
|
|
||||||
this.Cursor = Cursors.WaitCursor;
|
|
||||||
tc.SelectedDisplayTabItem.MyDSOTabPanel.FixSymbolCharacters();
|
|
||||||
btnFixMSWord.Text = btnText;
|
|
||||||
this.Cursor = Cursors.Default;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void epAnnotations_Resize(object sender, EventArgs e)
|
private void epAnnotations_Resize(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -215,7 +215,8 @@ namespace Volian.Controls.Library
|
|||||||
this.groupPanelCheckoff.CanvasColor = System.Drawing.SystemColors.Control;
|
this.groupPanelCheckoff.CanvasColor = System.Drawing.SystemColors.Control;
|
||||||
this.groupPanelCheckoff.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
|
this.groupPanelCheckoff.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
|
||||||
this.groupPanelCheckoff.Controls.Add(this.cmbCheckoff);
|
this.groupPanelCheckoff.Controls.Add(this.cmbCheckoff);
|
||||||
this.groupPanelCheckoff.DisabledBackColor = System.Drawing.Color.Empty;
|
this.groupPanelCheckoff.Controls.Add(this.cbInitialLine);
|
||||||
|
this.groupPanelCheckoff.DisabledBackColor = System.Drawing.Color.Empty;
|
||||||
this.groupPanelCheckoff.Dock = System.Windows.Forms.DockStyle.Top;
|
this.groupPanelCheckoff.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
this.groupPanelCheckoff.Location = new System.Drawing.Point(0, 231);
|
this.groupPanelCheckoff.Location = new System.Drawing.Point(0, 231);
|
||||||
this.groupPanelCheckoff.Margin = new System.Windows.Forms.Padding(2);
|
this.groupPanelCheckoff.Margin = new System.Windows.Forms.Padding(2);
|
||||||
@@ -265,8 +266,7 @@ namespace Volian.Controls.Library
|
|||||||
this.cbInitialLine.Margin = new System.Windows.Forms.Padding(2);
|
this.cbInitialLine.Margin = new System.Windows.Forms.Padding(2);
|
||||||
this.cbInitialLine.Name = "cbInitialLine";
|
this.cbInitialLine.Name = "cbInitialLine";
|
||||||
this.cbInitialLine.Size = new System.Drawing.Size(112, 15);
|
this.cbInitialLine.Size = new System.Drawing.Size(112, 15);
|
||||||
this.superTooltipTags.SetSuperTooltip(this.cbInitialLine, new DevComponents.DotNetBar.SuperTooltipInfo("Manual Page Break", "", "When set, starts this step at the top of a page.\r\n\r\nkeyboard command: <Ctrl><Ente" +
|
this.superTooltipTags.SetSuperTooltip(this.cbInitialLine, new DevComponents.DotNetBar.SuperTooltipInfo("Disable Initial Line", "", "When set, The initial line will be removed from this step.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
|
||||||
"r>", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
|
|
||||||
this.cbInitialLine.TabIndex = 1;
|
this.cbInitialLine.TabIndex = 1;
|
||||||
this.cbInitialLine.Text = "Disable Initial Line";
|
this.cbInitialLine.Text = "Disable Initial Line";
|
||||||
this.cbInitialLine.Visible = false;
|
this.cbInitialLine.Visible = false;
|
||||||
@@ -276,7 +276,6 @@ namespace Volian.Controls.Library
|
|||||||
//
|
//
|
||||||
this.groupPanelcmbShwRplWds.CanvasColor = System.Drawing.SystemColors.Control;
|
this.groupPanelcmbShwRplWds.CanvasColor = System.Drawing.SystemColors.Control;
|
||||||
this.groupPanelcmbShwRplWds.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
|
this.groupPanelcmbShwRplWds.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
|
||||||
this.groupPanelcmbShwRplWds.Controls.Add(this.cbInitialLine);
|
|
||||||
this.groupPanelcmbShwRplWds.Controls.Add(this.cmbShwRplWds);
|
this.groupPanelcmbShwRplWds.Controls.Add(this.cmbShwRplWds);
|
||||||
this.groupPanelcmbShwRplWds.DisabledBackColor = System.Drawing.Color.Empty;
|
this.groupPanelcmbShwRplWds.DisabledBackColor = System.Drawing.Color.Empty;
|
||||||
this.groupPanelcmbShwRplWds.Dock = System.Windows.Forms.DockStyle.Top;
|
this.groupPanelcmbShwRplWds.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
@@ -880,3 +879,4 @@ namespace Volian.Controls.Library
|
|||||||
private System.Windows.Forms.Button btnSaveChangeID;
|
private System.Windows.Forms.Button btnSaveChangeID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1400,15 +1400,25 @@ namespace Volian.Controls.Library
|
|||||||
if (SelectionLength > 0)HandleDeleteKeyWithSelectedText(new KeyEventArgs(Keys.None), null);
|
if (SelectionLength > 0)HandleDeleteKeyWithSelectedText(new KeyEventArgs(Keys.None), null);
|
||||||
int position = SelectionStart;
|
int position = SelectionStart;
|
||||||
SelectionLength = 0;
|
SelectionLength = 0;
|
||||||
|
// B2026-036 fixed issue where numbers after a dash character (in an RO return value) were trucated
|
||||||
|
// Needed to add a space after the \f0 in the string replace below. RTF was getting confused
|
||||||
|
// when there are number right after the \f0. Note also remove the space charcter after
|
||||||
|
// the \f1 command, as it is not needed since the \u commdn follows it.
|
||||||
|
// Here is the old code prior to when the foreach loop was added to handle symbols in RO value:
|
||||||
|
//
|
||||||
|
// linkValue = linkValue.Replace("\\u8209?", "\\f1\\u8209?\\f0 "); // dash character
|
||||||
|
// linkValue = linkValue.Replace("\\u9586?", "\\f1\\u9586?\\f0 "); // backslash symbol
|
||||||
|
// linkValue = linkValue.Replace("\\u916?", "\\f1\\u916?\\f0 "); // delta symbol
|
||||||
|
|
||||||
var pattern = @"\\u([0-9]{1,4})\?"; // RO Editor add symbols C2022 - 003
|
var pattern = @"\\u([0-9]{1,4})\?"; // RO Editor add symbols C2022 - 003
|
||||||
foreach (Match match in Regex.Matches(linkValue, pattern, RegexOptions.IgnoreCase))
|
foreach (Match match in Regex.Matches(linkValue, pattern, RegexOptions.IgnoreCase))
|
||||||
{
|
{
|
||||||
linkValue = linkValue.Replace(match.Value, "\\f1 " + match.Value + "\\f0");
|
linkValue = linkValue.Replace(match.Value, "\\f1" + match.Value + "\\f0 ");
|
||||||
}
|
}
|
||||||
|
|
||||||
linkValue = linkValue.Replace(@"{", @"\{");
|
linkValue = linkValue.Replace(@"{", @"\{");
|
||||||
linkValue = linkValue.Replace(@"}", @"\}");
|
linkValue = linkValue.Replace(@"}", @"\}");
|
||||||
|
|
||||||
SelectedRtf = @"{\rtf1\ansi" + FontTable + @"{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}\v" + FontSize + @" <START]\v0\cf1 " + linkValue + @"\cf0\v " + linkUrl + @"[END>\v0 }";
|
SelectedRtf = @"{\rtf1\ansi" + FontTable + @"{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}\v" + FontSize + @" <START]\v0\cf1 " + linkValue + @"\cf0\v " + linkUrl + @"[END>\v0 }";
|
||||||
this.SelectionLength = 0;
|
this.SelectionLength = 0;
|
||||||
this.SelectionStart = position;
|
this.SelectionStart = position;
|
||||||
|
|||||||
@@ -960,7 +960,9 @@ namespace Volian.Print.Library
|
|||||||
OnStatusChanged("After NewPage", PromsPrinterStatusType.NewPage);
|
OnStatusChanged("After NewPage", PromsPrinterStatusType.NewPage);
|
||||||
if (myProcedure.Sections == null)
|
if (myProcedure.Sections == null)
|
||||||
{
|
{
|
||||||
MessageBox.Show("This procedure has no content and will not be printed.", "Empty Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
// C2026-033 if we are running baselines, don't display the empty procedure message box, instead continue on as if OK was pressed.
|
||||||
|
if (!BaselineTesting)
|
||||||
|
MessageBox.Show("This procedure has no content and will not be printed.", "Empty Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
ProfileTimer.Pop(profileDepth);
|
ProfileTimer.Pop(profileDepth);
|
||||||
// B2024-062 Added check for EmptyProcedure. This is to prevent the Try Again message
|
// B2024-062 Added check for EmptyProcedure. This is to prevent the Try Again message
|
||||||
// from appearing after the user clicks on the OK button from the Empty Procedure message
|
// from appearing after the user clicks on the OK button from the Empty Procedure message
|
||||||
|
|||||||
@@ -491,10 +491,12 @@ namespace XYPlots
|
|||||||
// remove an extra spaces between ><
|
// remove an extra spaces between ><
|
||||||
//Buff = Regex.Replace(Buff, @"[ ]+<", "<");
|
//Buff = Regex.Replace(Buff, @"[ ]+<", "<");
|
||||||
Buff = Buff.Replace(">\r ", ">\r\n ");
|
Buff = Buff.Replace(">\r ", ">\r\n ");
|
||||||
|
Buff = Buff.Replace(">\n ", ">\r\n "); // C2022-003 if RO has symbols
|
||||||
Buff = Regex.Replace(Buff, @"[ ]+<", "<");
|
Buff = Regex.Replace(Buff, @"[ ]+<", "<");
|
||||||
// some data only had carriage return, replace these with cr/nl so that following code
|
// some data only had carriage return, replace these with cr/nl so that following code
|
||||||
// will work
|
// will work
|
||||||
Buff = Buff.Replace(">\r<", ">\r\n<");
|
Buff = Buff.Replace(">\r<", ">\r\n<");
|
||||||
|
Buff = Buff.Replace(">\n<", ">\r\n<"); // C2022-003 if RO has symbols
|
||||||
Buff = Buff.Replace("><", ">\r\n<");
|
Buff = Buff.Replace("><", ">\r\n<");
|
||||||
// some data had cr/cr/nl, change to cr/nl
|
// some data had cr/cr/nl, change to cr/nl
|
||||||
Buff = Buff.Replace("\r\r\n", "\r\n");
|
Buff = Buff.Replace("\r\r\n", "\r\n");
|
||||||
@@ -520,6 +522,7 @@ namespace XYPlots
|
|||||||
Buff = Buff.Substring(0, Buff.Length - 2) + " \r\n\0x00"; // needs to end with null
|
Buff = Buff.Substring(0, Buff.Length - 2) + " \r\n\0x00"; // needs to end with null
|
||||||
else if (Buff.EndsWith(">")) // doesn't end with return chars...
|
else if (Buff.EndsWith(">")) // doesn't end with return chars...
|
||||||
Buff = Buff.Substring(0, Buff.Length - 1) + " \r\n\0x00"; // needs to end with null
|
Buff = Buff.Substring(0, Buff.Length - 1) + " \r\n\0x00"; // needs to end with null
|
||||||
|
Buff = Regex.Replace(Buff, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); // C2022-003 RO Symbols. Convert unicode to character.
|
||||||
Buff = Regex.Replace(Buff, @"([0-9])\r\n([0-9])", "$1 $2");
|
Buff = Regex.Replace(Buff, @"([0-9])\r\n([0-9])", "$1 $2");
|
||||||
}
|
}
|
||||||
private void CloseGraph()
|
private void CloseGraph()
|
||||||
|
|||||||
@@ -2,13 +2,14 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Drawing;
|
|
||||||
using System.Drawing.Printing;
|
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.Drawing.Printing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Windows.Forms;
|
||||||
using VG;
|
using VG;
|
||||||
//using XYPlots;
|
//using XYPlots;
|
||||||
|
|
||||||
@@ -21,6 +22,10 @@ namespace XYPlots
|
|||||||
public frmXYPlot(string title,string xyPlot)
|
public frmXYPlot(string title,string xyPlot)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
title = Regex.Replace(title, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); // C2022-003 RO Symbols. Convert unicode to character.
|
||||||
|
xyPlot = Regex.Replace(xyPlot, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); // C2022-003 RO Symbols. Convert unicode to character.
|
||||||
|
|
||||||
int pstart = xyPlot.IndexOf("<<G"); // find the starting Plot Command
|
int pstart = xyPlot.IndexOf("<<G"); // find the starting Plot Command
|
||||||
xyPlot = xyPlot.Substring(pstart); // set val to the start of the plot commands
|
xyPlot = xyPlot.Substring(pstart); // set val to the start of the plot commands
|
||||||
_XYPlot =xyPlot;
|
_XYPlot =xyPlot;
|
||||||
|
|||||||
Reference in New Issue
Block a user