From 6915244da56962ef0457075e30727ce2d30336df Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Fri, 13 May 2016 15:57:13 +1000 Subject: [PATCH] Fix bug where fixed (left) column(s) in grid control may have uninit. width. This made the template grid view blank (light grey). --- HexEdit/GridCtrl_src/GridCtrl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HexEdit/GridCtrl_src/GridCtrl.cpp b/HexEdit/GridCtrl_src/GridCtrl.cpp index 5a45bcc3..d6617a08 100644 --- a/HexEdit/GridCtrl_src/GridCtrl.cpp +++ b/HexEdit/GridCtrl_src/GridCtrl.cpp @@ -5171,11 +5171,12 @@ void CGridCtrl::ExpandColsNice(BOOL bExpandFixed /*=TRUE*/, UINT nAutoSizeStyle if (m_arColWidths[col] == 0) // skip hidden columns continue; - int new_width; + int new_width = m_arColWidths[col]; // default to old width if (col == last_col && fixed_width + var_width < rect.Width()) new_width = rect.Width() - total_width; // if expanding set last adjustable column to match window width exactly else if ((col >= GetFixedColumnCount() || bExpandFixed) && m_arColWidths[col] > 0) new_width = int(min_size[col] * factor); + if (OnResizeColumn(col, new_width)) m_arColWidths[col] = new_width;