From: Kimmo Varis Date: Mon, 3 Jul 2006 06:33:58 +0000 (+0000) Subject: PATCH: [ 1515380 ] Page Up/Down Anomaly X-Git-Tag: 2.16.5~4977 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=0fe63398bc9112ef5bc7956ecf91820fd826fb38;p=winmerge-jp%2Fwinmerge-jp.git PATCH: [ 1515380 ] Page Up/Down Anomaly - submitted by Ed_K --- diff --git a/Src/Changes.txt b/Src/Changes.txt index a38eddf42..22a8e3d2f 100644 --- a/Src/Changes.txt +++ b/Src/Changes.txt @@ -2,6 +2,11 @@ Src\Changes.txt Add new items to top. (This summarizes all changes to all files under Src, including Src\Languages.) +2006-07-03 Kimmo + PATCH: [ 1515380 ] Page Up/Down Anomaly + Submitted by Ed_K + Src/editlib: ccrystaltextview2.cpp + 2006-07-02 Kimmo PATCH: [ 1515669 ] Add selected difference marker for locationview Src: LocationView.cpp LocationView.h diff --git a/Src/editlib/ccrystaltextview2.cpp b/Src/editlib/ccrystaltextview2.cpp index c60c74aae..a63005c9c 100644 --- a/Src/editlib/ccrystaltextview2.cpp +++ b/Src/editlib/ccrystaltextview2.cpp @@ -368,49 +368,32 @@ MoveEnd (BOOL bSelect) void CCrystalTextView:: MovePgUp (BOOL bSelect) { - //BEGIN SW - // scrolling windows - int nNewTopSubLine = m_nTopSubLine - GetScreenLines() + 1; - if (nNewTopSubLine < 0) - nNewTopSubLine = 0; - if (m_nTopSubLine != nNewTopSubLine) - { - int nDummy; - int nNewTopLine; - GetLineBySubLine(nNewTopSubLine, nNewTopLine, nDummy); - m_ptCursorPos.y = nNewTopLine; - ScrollToSubLine(nNewTopSubLine); - UpdateSiblingScrollPos(FALSE); - } - - // setting cursor - CPoint subLinePos; - CharPosToPoint( m_ptCursorPos.y, m_ptCursorPos.x, subLinePos ); + // scrolling windows + int nNewTopSubLine = m_nTopSubLine - GetScreenLines() + 1; + if (nNewTopSubLine < 0) + nNewTopSubLine = 0; + if (m_nTopSubLine != nNewTopSubLine) + { + int nDummy; + int nNewTopLine; + GetLineBySubLine(nNewTopSubLine, nNewTopLine, nDummy); + m_ptCursorPos.y = nNewTopLine; + ScrollToSubLine(nNewTopSubLine); + UpdateSiblingScrollPos(FALSE); + } - int nSubLine = GetSubLineIndex( m_ptCursorPos.y ) + subLinePos.y - GetScreenLines() + 1; + // setting cursor + CPoint subLinePos; + CharPosToPoint( m_ptCursorPos.y, m_ptCursorPos.x, subLinePos ); - if( nSubLine < 0 ) - nSubLine = 0; + int nSubLine = GetSubLineIndex( m_ptCursorPos.y ) + subLinePos.y; - SubLineCursorPosToTextPos( - CPoint( m_nIdealCharPos, nSubLine ), m_ptCursorPos ); + if ( nSubLine < 0 ) + nSubLine = 0; - /*ORIGINAL - int nNewTopLine = m_nTopLine - GetScreenLines() + 1; - if (nNewTopLine < 0) - nNewTopLine = 0; - if (m_nTopLine != nNewTopLine) - { - ScrollToLine(nNewTopLine); - UpdateSiblingScrollPos(TRUE); - } + SubLineCursorPosToTextPos( CPoint( m_nIdealCharPos, nSubLine ), + m_ptCursorPos ); - m_ptCursorPos.y -= GetScreenLines() - 1; - if (m_ptCursorPos.y < 0) - m_ptCursorPos.y = 0; - if (m_ptCursorPos.x > GetLineLength(m_ptCursorPos.y)) - m_ptCursorPos.x = GetLineLength(m_ptCursorPos.y); - *///END SW m_nIdealCharPos = CalculateActualOffset (m_ptCursorPos.y, m_ptCursorPos.x); EnsureVisible (m_ptCursorPos); //todo: no vertical scroll