OSDN Git Service

PATCH: [ 1515380 ] Page Up/Down Anomaly
authorKimmo Varis <kimmov@gmail.com>
Mon, 3 Jul 2006 06:33:58 +0000 (06:33 +0000)
committerKimmo Varis <kimmov@gmail.com>
Mon, 3 Jul 2006 06:33:58 +0000 (06:33 +0000)
 - submitted by Ed_K

Src/Changes.txt
Src/editlib/ccrystaltextview2.cpp

index a38eddf..22a8e3d 100644 (file)
@@ -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
index c60c74a..a63005c 100644 (file)
@@ -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