From e19db7264776f28fed5c585202d34a562d0107c5 Mon Sep 17 00:00:00 2001 From: Rich Date: Tue, 19 Jul 2016 14:25:29 +0000 Subject: [PATCH] B2016-173 Transition to MS Word section causes crash B2016-135 Hanging Indent crash on History B2016-162 Backslash typed into table cell does not get saved as a Backslash --- .../DisplayTransition.cs | 1 + PROMS/Volian.Controls.Library/StepRTB.cs | 2 + PROMS/Volian.Controls.Library/VlnFlexGrid.cs | 63 ++++++++++--------- 3 files changed, 37 insertions(+), 29 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayTransition.cs b/PROMS/Volian.Controls.Library/DisplayTransition.cs index 31cceab2..db39d462 100644 --- a/PROMS/Volian.Controls.Library/DisplayTransition.cs +++ b/PROMS/Volian.Controls.Library/DisplayTransition.cs @@ -78,6 +78,7 @@ namespace Volian.Controls.Library if (_II_Procedure != cbTranProcs.SelectedIndex) return true; if (_II_Section != cbTranSects.SelectedIndex) return true; // Use VEObject + if(tvTran.Nodes.Count == 0) return true;//B2016-173 If no nodes then the transtion is to a MS Word Section if (_II_ItemID != ((tvTran.SelectedNode as VETreeNode).VEObject as ItemInfo).ItemID) return true; return false; } diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 5596670f..8545e3cb 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -1096,6 +1096,8 @@ namespace Volian.Controls.Library { this.Invalidate(); base.WndProc(ref m); + // B2016-135 Don't Show Hanging Indent if MyItemInfo is null + if (MyItemInfo == null) return; if ((FieldToEdit == E_FieldToEdit.StepText) && (SelectionHangingIndent > 0 || SelectionIndent > 0) && (ActiveMode || MyItemInfo.IsTable)) { using (Graphics g = Graphics.FromHwnd(this.Handle)) diff --git a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs index e6745dc6..8a45e881 100644 --- a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs +++ b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs @@ -1638,18 +1638,18 @@ namespace Volian.Controls.Library public void RTFTextAlignment(CellRange cr, HorizontalAlignment ha) { - using (StepRTB srtb = new StepRTB()) - { - for (int rw = cr.r1; rw <= cr.r2; rw++) - for (int cl = cr.c1; cl <= cr.c2; cl++) - { - srtb.Rtf = this.GetCellRTFString(rw, cl); - srtb.SelectAll(); - srtb.SelectionAlignment = ha; - this.PutCellRTFString(rw, cl, srtb.Rtf); - } + using (StepRTB srtb = new StepRTB()) + { + for (int rw = cr.r1; rw <= cr.r2; rw++) + for (int cl = cr.c1; cl <= cr.c2; cl++) + { + srtb.Rtf = this.GetCellRTFString(rw, cl); + srtb.SelectAll(); + srtb.SelectionAlignment = ha; + this.PutCellRTFString(rw, cl, srtb.Rtf); + } + } } - } public void SetTableBorder(C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum border) @@ -1659,23 +1659,23 @@ namespace Volian.Controls.Library } public void ChangeCellAlign(CellRange cr, TextAlignEnum newAlign) { - for (int rw = cr.r1; rw <= cr.r2; rw++) - for (int col = cr.c1; col <= cr.c2; col++) - { - CellRange tmp = this.GetCellRange(rw, col, rw, col); - string StyleName = string.Format("R{0}C{1}Style", rw, col); - CellStyle cs = null; - if (Styles.Contains(StyleName)) - cs = Styles[StyleName]; - else - cs = this.Styles.Add(StyleName, tmp.Style); - cs.TextAlign = newAlign; - tmp.Style = cs; - } - // If one column and one row, then go into edit mode. - if (cr.r1 == cr.r2 && cr.c1 == cr.c2) - SendKeys.Send("{F2}"); // Toggle Edit Mode with F2 - } + for (int rw = cr.r1; rw <= cr.r2; rw++) + for (int col = cr.c1; col <= cr.c2; col++) + { + CellRange tmp = this.GetCellRange(rw, col, rw, col); + string StyleName = string.Format("R{0}C{1}Style", rw, col); + CellStyle cs = null; + if (Styles.Contains(StyleName)) + cs = Styles[StyleName]; + else + cs = this.Styles.Add(StyleName, tmp.Style); + cs.TextAlign = newAlign; + tmp.Style = cs; + } + // If one column and one row, then go into edit mode. + if (cr.r1 == cr.r2 && cr.c1 == cr.c2) + SendKeys.Send("{F2}"); // Toggle Edit Mode with F2 + } public void ChangeCellBorder(CellRange cr, BorderStyleEnum newBorder) { for (int rw = cr.r1; rw <= cr.r2; rw++) @@ -4625,7 +4625,12 @@ namespace Volian.Controls.Library Text = ""; FindAllLinks(); // jsj 1-5-2011 if (_pendingKey > ' ' && !ReadOnly) - Text = _pendingKey.ToString(); + { + if(_pendingKey == '\\') + SendKeys.Send("\\"); // B2016-162 Send a backslash which will be converted to "\u9586?" + else + Text = _pendingKey.ToString(); + } else if (_owner[row, col] != null) { string tmp = _owner[row, col].ToString();