From 3ca78ece20aea32b749463527f09042436a6d332 Mon Sep 17 00:00:00 2001 From: Laurent Ganier Date: Fri, 11 Jul 2003 22:54:17 +0000 Subject: [PATCH] [ 769122 ] Keep top screen line within the shorter panel --- Src/MergeEditView.cpp | 15 +++++++++++++++ Src/readme.txt | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/Src/MergeEditView.cpp b/Src/MergeEditView.cpp index c9742b492..af7807213 100644 --- a/Src/MergeEditView.cpp +++ b/Src/MergeEditView.cpp @@ -228,12 +228,27 @@ void CMergeEditView::UpdateSiblingScrollPos (BOOL bHorz) ASSERT (nCurrentRow >= 0 && nCurrentRow < pSplitterWnd->GetRowCount ()); ASSERT (nCurrentCol >= 0 && nCurrentCol < pSplitterWnd->GetColumnCount ()); + // limit the TopLine : must be smaller than GetLineCount for all the panels + int newTopLine = m_nTopLine; int nRows = pSplitterWnd->GetRowCount (); int nCols = pSplitterWnd->GetColumnCount (); for (int nRow = 0; nRow < nRows; nRow++) { for (int nCol = 0; nCol < nCols; nCol++) { + CMergeEditView *pSiblingView = static_cast(GetSiblingView (nRow, nCol)); + if (pSiblingView != NULL) + if (pSiblingView->GetLineCount() <= newTopLine) + newTopLine = pSiblingView->GetLineCount()-1; + } + } + if (m_nTopLine != newTopLine) + ScrollToLine(newTopLine); + + for (nRow = 0; nRow < nRows; nRow++) + { + for (int nCol = 0; nCol < nCols; nCol++) + { if (!(nRow == nCurrentRow && nCol == nCurrentCol)) // We don't need to update ourselves { CMergeEditView *pSiblingView = static_cast(GetSiblingView (nRow, nCol)); diff --git a/Src/readme.txt b/Src/readme.txt index 16da545bb..729a437bd 100644 --- a/Src/readme.txt +++ b/Src/readme.txt @@ -1,3 +1,7 @@ +2003-07-12 Laoran + PATCH: [ 769122 ] Keep top screen line within the shorter panel + WinMerge: MergeEditView.cpp + 2003-07-11 Perry PATCH: [ 765150 ] Fix char count in edit view bottom status line WinMerge: ChildFrm.cpp ChildFrm.h Merge.rc MergeEditStatus.h -- 2.11.0