diff --git a/PROMS/Volian.Controls.Library/DisplayText.cs b/PROMS/Volian.Controls.Library/DisplayText.cs index c44edaa3..de382729 100644 --- a/PROMS/Volian.Controls.Library/DisplayText.cs +++ b/PROMS/Volian.Controls.Library/DisplayText.cs @@ -1477,7 +1477,7 @@ namespace Volian.Controls.Library Match myMatch = regRefObj.Match(link); if (myMatch.Success) { - int dbid = int.Parse(myMatch.Groups[2].Value.Substring(0, 4))-1; + int dbid = int.Parse(myMatch.Groups[2].Value.Substring(0, 4)); int rodbid = int.Parse(myMatch.Groups[3].Value); ROFstInfo myROFst = myDocVersion.GetROFst(rodbid); return myROFst.IsSetpointDB(dbid); diff --git a/PROMS/Volian.Controls.Library/FindReplace.cs b/PROMS/Volian.Controls.Library/FindReplace.cs index d372c188..0baa0cc2 100644 --- a/PROMS/Volian.Controls.Library/FindReplace.cs +++ b/PROMS/Volian.Controls.Library/FindReplace.cs @@ -16,15 +16,15 @@ namespace Volian.Controls.Library private bool findingbookmarks = false; //private bool _offsetStartPos = false; - private StepItem _MyStepItem; - public StepItem MyStepItem + private RTBItem _MyRTBItem; + public RTBItem MyRTBItem { - get { return _MyStepItem; } + get { return _MyRTBItem; } set { - _MyStepItem = value; - //DocVersionInfo dvi = _MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; //MyStepItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; - _MyDocVersion = _MyStepItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; + _MyRTBItem = value; + //DocVersionInfo dvi = _MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; //MyRTBItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; + _MyDocVersion = _MyRTBItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; SetupContextMenu(); //_offsetStartPos = false; // in a different rtf box, don't offset find position first time around } @@ -35,9 +35,9 @@ namespace Volian.Controls.Library // get // { // if (_MyDVI != null) return _MyDVI; - // if (_MyStepItem != null) + // if (_MyRTBItem != null) // { - // ItemInfo procInfo = _MyStepItem.MyItemInfo.MyProcedure as ItemInfo; + // ItemInfo procInfo = _MyRTBItem.MyItemInfo.MyProcedure as ItemInfo; // if (procInfo == null) return null; // _MyDVI = procInfo.ActiveParent as DocVersionInfo; // return _MyDVI; @@ -81,7 +81,7 @@ namespace Volian.Controls.Library public FindReplace() { - //DocVersionInfo dvi = MyStepItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; + //DocVersionInfo dvi = MyRTBItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; InitializeComponent(); LoadFindReplaceTextListBox(); //if (dvi != null && dvi.VersionType > 127) @@ -91,8 +91,8 @@ namespace Volian.Controls.Library btnFindNext.Enabled = false; btnReplace.Enabled = false; btnRplAll.Enabled = false; - //if (MyStepItem.MyStepRTB.SelectionLength > 0) - // cmboFindText.Text = MyStepItem.MyStepRTB.SelectedText; + //if (MyRTBItem.MyStepRTB.SelectionLength > 0) + // cmboFindText.Text = MyRTBItem.MyStepRTB.SelectedText; cmboFindText.Focus(); //SetupContextMenu(); } @@ -114,10 +114,10 @@ namespace Volian.Controls.Library } } - //public FindReplace(StepItem stpitm) + //public FindReplace(RTBItem stpitm) //{ - // MyStepItem = stpitm; - // DocVersionInfo dvi = MyStepItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; + // MyRTBItem = stpitm; + // DocVersionInfo dvi = MyRTBItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; // InitializeComponent(); // if (dvi != null && dvi.VersionType > 127) // InApproved = false; // in approved @@ -126,8 +126,8 @@ namespace Volian.Controls.Library // btnFindNext.Enabled = false; // btnReplace.Enabled = false; // btnRplAll.Enabled = false; - // if (MyStepItem.MyStepRTB.SelectionLength > 0) - // cmboFindText.Text = MyStepItem.MyStepRTB.SelectedText; + // if (MyRTBItem.MyStepRTB.SelectionLength > 0) + // cmboFindText.Text = MyRTBItem.MyStepRTB.SelectedText; // cmboFindText.Focus(); //} @@ -136,7 +136,7 @@ namespace Volian.Controls.Library { btnFindNext_Click(sender, e); if (found) // found is set in btnFindNext_Click() - MyStepItem.MyStepRTB.ReplaceText(cmboReplaceText.Text, cmboFindText.Text, cbxCaseSensitive.Checked, cbxWholeWord.Checked, cbxReverse.Checked, false, null); + MyRTBItem.MyStepRTB.ReplaceText(cmboReplaceText.Text, cmboFindText.Text, cbxCaseSensitive.Checked, cbxWholeWord.Checked, cbxReverse.Checked, false, null); } private void btnRplAll_Click(object sender, EventArgs e) @@ -144,7 +144,7 @@ namespace Volian.Controls.Library btnFindNext_Click(sender, e); while (found) // found is set in btnFindNext_Click() { - if (MyStepItem.MyStepRTB.ReplaceText(cmboReplaceText.Text, cmboFindText.Text, cbxCaseSensitive.Checked, cbxWholeWord.Checked, cbxReverse.Checked, true, this) == DialogResult.Cancel) + if (MyRTBItem.MyStepRTB.ReplaceText(cmboReplaceText.Text, cmboFindText.Text, cbxCaseSensitive.Checked, cbxWholeWord.Checked, cbxReverse.Checked, true, this) == DialogResult.Cancel) found = false; else btnFindNext_Click(sender, e); @@ -157,11 +157,11 @@ namespace Volian.Controls.Library btnFindNext_Click(sender, e); while (found) // found is set in btnFindNext_Click() { - MyDisplayBookMarks.AddBookMark(MyStepItem.MyItemInfo); + MyDisplayBookMarks.AddBookMark(MyRTBItem.MyItemInfo); btnFindNext_Click(sender, e); } StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Bookmarks"); - MyStepItem.MyStepPanel.OnTabDisplay(sender, args); + MyRTBItem.MyStepPanel.OnTabDisplay(sender, args); findingbookmarks = false; } @@ -177,9 +177,9 @@ namespace Volian.Controls.Library found = false; AddToComboLists(); doingfind = true; - while (!MyStepItem.MyStepRTB.FindText(cmboFindText.Text, cbxCaseSensitive.Checked, cbxWholeWord.Checked, cbxReverse.Checked)) + while (!MyRTBItem.MyStepRTB.FindText(cmboFindText.Text, cbxCaseSensitive.Checked, cbxWholeWord.Checked, cbxReverse.Checked)) { - ItemInfo next = (cbxReverse.Checked) ? MyStepItem.MyItemInfo.SearchPrev : MyStepItem.MyItemInfo.SearchNext; + ItemInfo next = (cbxReverse.Checked) ? MyRTBItem.MyItemInfo.SearchPrev : MyRTBItem.MyItemInfo.SearchNext; while (!next.IsSection && !next.MyContent.Text.ToUpper().Contains(cmboFindText.Text.ToUpper())) next = (cbxReverse.Checked) ? next.SearchPrev : next.SearchNext; if (next.IsSection) @@ -193,11 +193,11 @@ namespace Volian.Controls.Library } return; } - MyStepItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(next); + MyRTBItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(next); if (cbxReverse.Checked) - MyStepItem.MyStepRTB.SelectionStart = MyStepItem.MyStepRTB.Text.Length; + MyRTBItem.MyStepRTB.SelectionStart = MyRTBItem.MyStepRTB.Text.Length; } - MyStepItem.MyStepRTB.Focus(); + MyRTBItem.MyStepRTB.Focus(); found = true; } @@ -358,7 +358,7 @@ namespace Volian.Controls.Library private void FindReplace_Activated(object sender, EventArgs e) { - StepRTB srtb = MyStepItem.MyStepRTB; + StepRTB srtb = MyRTBItem.MyStepRTB; if (srtb.SelectionLength > 0 && !doingfind) { if (srtb.IsSelectionLinked(srtb.SelectionStart, srtb.SelectionLength))