C2026-043-Tech-Debt_v1 - Stash 1

This commit is contained in:
2026-07-21 06:49:28 -04:00
parent 0fed1acfd8
commit 9486b37300
70 changed files with 4222 additions and 10191 deletions
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
@@ -109,7 +107,6 @@ namespace Volian.Controls.Library
// C2019-021 RHM 5/15/2019 Added new methods and properties for Import Word Content
_WordApp.Selection.MoveUp(LBWdUnits.wdParagraph, 1, 0); // Move to previous paragraph
_WordApp.Selection.MoveUp(LBWdUnits.wdParagraph, 1, 1); // Select paragraph
//_WordApp.Selection.MoveEnd(LBWdUnits.wdCharacter, -1); // Move 1 Character Back
try
{
// C2019-021 Use generic function CopyWordText
@@ -294,34 +291,6 @@ namespace Volian.Controls.Library
// incase user manually closed word
}
}
//C2019-021 Remove old method.
//private void btnNextIns_Click(object sender, EventArgs e)
//{
// if (MyStepRTB != null)
// {
// if (MyStepRTB.MyItemInfo.IsSection)
// {
// MyStepRTB.RtbSendKeys("^{DOWN}"); // <Ctrl><down arrow> - next edit window
// MyStepRTB.RtbSendKeys("^+b"); // insert previous
// }
// else
// MyStepRTB.RtbSendKeys("^+i"); // insert next (same type and level)
// MyStepRTB.RtbSendKeys("^v"); // clipboard paste
// Application.DoEvents();
// }
// this.Focus(); // set focus back to this form
//}
//private void btnNextRpl_Click(object sender, EventArgs e)
//{
// if (MyStepRTB != null)
// {
// MyStepRTB.RtbSendKeys("^{DOWN}"); // <Ctrl><down arrow> - next edit window
// MyStepRTB.RtbSendKeys("^a"); // select all
// MyStepRTB.RtbSendKeys("^v"); // clipboard paste
// Application.DoEvents();
// }
// this.Focus(); // set focus back to this form
//}
// C2019-021 New function to replace the PROMS text with the word text and move to the next paragraph in word.
private void btnReplaceNext_Click(object sender, EventArgs e)
{
@@ -382,7 +351,6 @@ namespace Volian.Controls.Library
if (MyStepRTB.Parent is VlnFlexGrid)
{
VlnFlexGrid vg = MyStepRTB.Parent as VlnFlexGrid;
//vg.FinishEditing(false);
vg.SelectNextCell();
}
else
@@ -498,9 +466,6 @@ namespace Volian.Controls.Library
private void btnCurrent_Click(object sender, EventArgs e)
{
// B2019-108 Corrected curent button code
//_WordApp.Selection.MoveUp(LBWdUnits.wdParagraph, 1, 0); // Select paragraph
//_WordApp.Selection.MoveDown(LBWdUnits.wdParagraph, 1, 1); // Select paragraph
//_WordApp.Selection.MoveEnd(LBWdUnits.wdCharacter, -1); // Exclude the last character
try
{
_WordApp.Selection.Cells[1].Range.Select();
@@ -514,9 +479,6 @@ namespace Volian.Controls.Library
// C2019-021 Use Generic CopyWordText
CopyWordText();
// C2019-021If the word text only contains whitespace skip to next
//if (txbWrdText.Text.TrimEnd("\f\r\n\a".ToCharArray()) == "")
// btnNext_Click(sender, e);
//else
Clipboard.SetText(txbWrdText.Text);
}
catch
@@ -524,16 +486,6 @@ namespace Volian.Controls.Library
// Ask RHM what to do here 2/28/2020 JBS
}
}
//private void btnTest_Click(object sender, EventArgs e)
//{
// if (!MoveToNextCell())
// {
// _WordApp.Selection.MoveDown(LBWdUnits.wdParagraph, 2, 0);
// _WordApp.Selection.MoveDown(LBWdUnits.wdParagraph, 1, 1);
// }
// _WordApp.Activate();
// //int cols = _WordApp.Selection.Tables[1].Columns.Count;
//}
// B2019-108 Show special Characters
private void txbWrdText_TextChanged(object sender, EventArgs e)
@@ -562,9 +514,6 @@ namespace Volian.Controls.Library
private void frmImportWordContents_Activated(object sender, EventArgs e)
{
// B2019-108 Corrected curent button code
//_WordApp.Selection.MoveUp(LBWdUnits.wdParagraph, 1, 0); // Select paragraph
//_WordApp.Selection.MoveDown(LBWdUnits.wdParagraph, 1, 1); // Select paragraph
//_WordApp.Selection.MoveEnd(LBWdUnits.wdCharacter, -1); // Exclude the last character
try
{
if (_WordApp != null || _WordApp.WindowState == LBWdWindowState.wdWindowStateMinimize)
@@ -576,16 +525,6 @@ namespace Volian.Controls.Library
disableButtons();
}
}
//private void btnTest_Click(object sender, EventArgs e)
//{
// if (!MoveToNextCell())
// {
// _WordApp.Selection.MoveDown(LBWdUnits.wdParagraph, 2, 0);
// _WordApp.Selection.MoveDown(LBWdUnits.wdParagraph, 1, 1);
// }
// _WordApp.Activate();
// //int cols = _WordApp.Selection.Tables[1].Columns.Count;
//}
private void btnTableConvert_Click(object sender, EventArgs e)
{
@@ -613,12 +552,11 @@ namespace Volian.Controls.Library
else
sb.Append(c);
}
MessageBox.Show(ex.Message + "\r\n" + sb.ToString(), ex.GetType().Name);
MessageBox.Show($"{ex.Message}\r\n{sb}", ex.GetType().Name);
return;
}
LoadTable2(xd.DocumentElement);
int type = 20008;
ItemInfo myTable;
if(MyStepRTB.MyItemInfo.IsTable)
{
using( Item itm = MyStepRTB.MyItemInfo.Get())
@@ -633,12 +571,6 @@ namespace Volian.Controls.Library
}
else
{
//using (Step stp = Step.MakeStep(MyStepRTB.MyItemInfo, null, null, TblFlexGrid.GetSearchableText() , 20008, E_FromType.Table))
//{
// myTable = ItemInfo.Get(stp.ItemID);
// Grid.MakeGrid(stp.MyContent, TblFlexGrid.GetXMLData(), "");
//}
//MyStepRTB.MyItemInfo.MyContent.RefreshContentParts();
EditItem ei = MyStepRTB.Parent as EditItem;
ei.AddChild(E_FromType.Table, 20008, TblFlexGrid);
if (ei != null) ei.SetAllTabs();
@@ -671,7 +603,6 @@ namespace Volian.Controls.Library
// capture widths for valid cells
for (int i = 1; i <= tbl.Range.Cells.Count; i++)
{
//LBCell myCell = tbl.Range.Cells[i];
// convert points to pixels and save value
int w = (int)(tbl.Range.Cells[i].Width * 8 / 6);
iC = tbl.Range.Cells[i].ColumnIndex - 1;
@@ -774,16 +705,16 @@ namespace Volian.Controls.Library
iC = myCell.ColumnIndex - 1 + offset;
if (SpanR[iR, iC] > 1)
{
sXML += " rowspan=\"" + SpanR[iR, iC] + "\"";
sXML += $" rowspan=\"{SpanR[iR, iC]}\"";
}
if (SpanC[iR, iC] > 1)
{
sXML += " colspan=\"" + SpanC[iR, iC] + "\"";
sXML += $" colspan=\"{SpanC[iR, iC]}\"";
offset += SpanC[iR, iC] - 1;
}
else if (Wcol[iC] > 0)
{
sXML += " width=\"" + Wcol[iC] + "\"";
sXML += $" width=\"{Wcol[iC]}\"";
Wcol[iC] = Wcol[iC] * -1;
}
string textalign = "";
@@ -815,7 +746,7 @@ namespace Volian.Controls.Library
textalign += "Top";
break;
}
sXML += " textalign=\"" + textalign + "\"";
sXML += $" textalign=\"{textalign}\"";
sXML += ">";
// select text from current cell
_WordApp.Selection.Start = myCell.Range.Start;
@@ -830,7 +761,6 @@ namespace Volian.Controls.Library
rtbStep.SelectAll();
Console.WriteLine("RTF before {0}", rtbStep.Rtf);
Console.WriteLine("RTF after {0}", rtbStep.Rtf);
// rtbStep.Rtf.Replace("\\f1 P\\f0 ", "\\u10004?"); // check mark within parenthesis
string strp = rtbStep.Rtf.Replace("\\par\r\n", "!!!");
strp = DisplayText.StaticStripRtfCommands(strp, true);
Console.WriteLine("RTF clean {0}", strp);
@@ -849,11 +779,9 @@ namespace Volian.Controls.Library
sb.Replace("\x201D", "\"");// Space
sb.Replace("\x09INITIAL", "");// Space
sb.Replace("\x09_____", ""); // Tab Signoff
//sb.Replace("(P)", "(\\u10004?)"); // check mark within parenthesis
//sb.Replace("\\u9633?", "&#9633;"); //box
}
// save resulting text in xml structure
sXML += "<p>" + ha + sb + "</p></td>";
sXML += $"<p>{ha}{sb}</p></td>";
}
else
{