OSDN Git Service

PATCH: [ 1145522 ] fix crash on search
authorKimmo Varis <kimmov@gmail.com>
Tue, 22 Feb 2005 17:35:56 +0000 (17:35 +0000)
committerKimmo Varis <kimmov@gmail.com>
Tue, 22 Feb 2005 17:35:56 +0000 (17:35 +0000)
 - submitted by Takashi Sawanaka

Src/editlib/ccrystaltextview.cpp
Src/readme.txt

index f90edaa..4a0422d 100644 (file)
@@ -4123,7 +4123,10 @@ HighlightText (const CPoint & ptStartPos, int nLength, BOOL bReverse /*= FALSE*/
   int nScreenLines = GetScreenLines();
   if (ptStartPos.y < m_nTopLine || ptEndPos.y > m_nTopLine + nScreenLines)
     {
-      ScrollToLine(ptStartPos.y - nScreenLines / 2);
+      if (ptStartPos.y > nScreenLines / 2)
+        ScrollToLine(ptStartPos.y - nScreenLines / 2);
+      else
+        ScrollToLine(ptStartPos.y);
       UpdateSiblingScrollPos (FALSE);
     }
   EnsureVisible (ptStartPos, ptEndPos);
index 505522d..ac80784 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-22 Kimmo
+ PATCH: [ 1145522 ] fix crash on search
+  Submitted by Takashi Sawanaka
+  Src/editlib: ccrystaltextview.cpp
+
 2005-02-21 Kimmo
  Update Docbook instructions in devel doc (path changed in sf.net)
   Docs/Developers: readme-developers.html