From 2ed397b4f94907275e12fedf72eb5c544942a540 Mon Sep 17 00:00:00 2001 From: sdottaka Date: Thu, 18 Dec 2014 22:28:01 +0900 Subject: [PATCH] HexMergeView.cpp: Fix crash when scrolling horizontally in the HexView --HG-- branch : stable --- Src/HexMergeView.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Src/HexMergeView.cpp b/Src/HexMergeView.cpp index 7a33646f8..cf0781c11 100644 --- a/Src/HexMergeView.cpp +++ b/Src/HexMergeView.cpp @@ -21,7 +21,7 @@ /** * @file HexMergeView.cpp * - * @brief Implementation file for CHexMergeDoc + * @brief Implementation file for CHexMergeView * */ // ID line follows -- this is updated by SVN @@ -180,12 +180,17 @@ void CHexMergeView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar * pScrollBar) { pScrollBar->SetScrollInfo(&si); } + CSplitterWndEx *pSplitter = static_cast(GetParentSplitter(this, TRUE)); - int nID = GetDlgCtrlID(); - nID ^= pSplitter->IdFromRowCol(0, 0) ^ pSplitter->IdFromRowCol(0, 1); - CWnd *pWnd = pSplitter->GetDlgItem(nID); - pWnd->SetScrollInfo(SB_HORZ, &si); - pWnd->SendMessage(WM_HSCROLL, MAKEWPARAM(nSBCode, nPos)); + for (int pane = 0; pane < pSplitter->GetColumnCount(); ++pane) + { + if (pane != m_nThisPane) + { + CWnd *pWnd = pSplitter->GetDlgItem(pSplitter->IdFromRowCol(0, pane)); + pWnd->SetScrollInfo(SB_HORZ, &si); + pWnd->SendMessage(WM_HSCROLL, MAKEWPARAM(nSBCode, nPos)); + } + } } } -- 2.11.0