OSDN Git Service

BUG: [ 1494610 ] Wrong selection in ccrystalview2.cpp
authorKimmo Varis <kimmov@gmail.com>
Thu, 25 May 2006 22:10:45 +0000 (22:10 +0000)
committerKimmo Varis <kimmov@gmail.com>
Thu, 25 May 2006 22:10:45 +0000 (22:10 +0000)
 - analyzed by Mallato

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

index 0bc9086..6fa5de4 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-05-25 Kimmo
+ BUG: [ 1494610 ] Wrong selection in ccrystalview2.cpp
+  Analyzed by Mallato
+  Src/editlib: ccrystaltextview2.cpp
+
 2006-05-25 Tim
  PATCH: [ 1495017 ] Translate 'Textcolors' options to German
   Src/Languages/German: MergeGerman.rc
index 3c2c0f4..a837673 100644 (file)
@@ -588,6 +588,12 @@ SelectAll ()
   UpdateCaret ();
 }
 
+/** 
+ * @brief Called when left mousebutton pressed down in editor.
+ * This function handles left mousebutton down in editor.
+ * @param [in] nFlags Flags indicating if virtual keys are pressed.
+ * @param [in] point Point where mousebutton is pressed.
+ */
 void CCrystalTextView::
 OnLButtonDown (UINT nFlags, CPoint point)
 {
@@ -620,14 +626,14 @@ OnLButtonDown (UINT nFlags, CPoint point)
           if (GetSubLineIndex (ptStart.y) + pos.y == GetSubLineCount() - 1)
             {
               // select to end of subline
-              ptStart = SubLineEndToCharPos (ptStart.y, pos.y);
+              ptEnd.x = SubLineEndToCharPos (ptStart.y, pos.y);
             }
           else
             {
               int nLine, nSubLine;
               GetLineBySubLine (GetSubLineIndex (ptStart.y) + pos.y + 1, nLine, nSubLine);
-              ptStart.y = nLine;
-              ptStart.x = SubLineHomeToCharPos (nLine, nSubLine);
+              ptEnd.y = nLine;
+              ptEnd.x = SubLineHomeToCharPos (nLine, nSubLine);
             }
 
           m_ptCursorPos = ptEnd;