Patch for bug 4561

From: Mikey Cooper <mikey_at_bluey.com>
Date: Wed May 26 2004 - 01:13:11 CEST

Attached is a patch for bug 4561 where PageUp/Dn will not move the insertion pointer to the beginning/end of the document if you're near the top/bottom. I'm not too familiar with the code, so can someone please review it before I commit? It works as far as I can tell but I'm not sure if there are special-case scenarios where it might fail.

Thanks!
Mikey

? src/wp/ap/win/ap_Win32Res_DlgStylist.rc
Index: src/text/fmt/xp/fv_View_protected.cpp
===================================================================
RCS file: /cvsroot/abi/src/text/fmt/xp/fv_View_protected.cpp,v
retrieving revision 1.160
diff -u -r1.160 fv_View_protected.cpp
--- src/text/fmt/xp/fv_View_protected.cpp 23 May 2004 03:12:03 -0000 1.160
+++ src/text/fmt/xp/fv_View_protected.cpp 25 May 2004 22:58:36 -0000
@@ -1882,7 +1882,20 @@
 
         iYnext = yoff + getWindowHeight() * iDir;
         iYscroll = m_yScrollOffset + (getWindowHeight() * iDir);
- if (iYscroll < 0) return;
+ if (iYscroll < 0)
+ {
+ // We're trying to scroll past beginning/end of document
+ // Move insertion pointer to BOD/EOD instead
+ if (iDir == 1)
+ {
+ moveInsPtTo(FV_DOCPOS_EOD);
+ }
+ else
+ {
+ moveInsPtTo(FV_DOCPOS_BOD);
+ }
+ return;
+ }
 
         xxx_UT_DEBUGMSG(("SEVIOR:!!!!!! Yoff %d iYnext %d page %x \n",yoff,iYnext,pPage));
 
Received on Wed May 26 01:04:29 2004

This archive was generated by hypermail 2.1.8 : Wed May 26 2004 - 01:04:29 CEST