OSDN Git Service

PATCH: [ 1220472 ] Don't lose selection when deleting items from dir compare
authorKimmo Varis <kimmov@gmail.com>
Wed, 15 Jun 2005 14:24:53 +0000 (14:24 +0000)
committerKimmo Varis <kimmov@gmail.com>
Wed, 15 Jun 2005 14:24:53 +0000 (14:24 +0000)
Src/DirActions.cpp
Src/readme.txt

index 4e794f5..ac286f7 100644 (file)
@@ -815,6 +815,7 @@ void CDirView::UpdateCopiedItems(ActionList & actionList)
  */
 void CDirView::UpdateDeletedItems(ActionList & actionList)
 {
+       int curSel = GetFirstSelectedInd();
        while (!actionList.deletedItems.IsEmpty())
        {
                int idx = actionList.deletedItems.RemoveTail();
@@ -822,6 +823,9 @@ void CDirView::UpdateDeletedItems(ActionList & actionList)
                GetDocument()->RemoveDiffByKey(diffpos);
                m_pList->DeleteItem(idx);
        }
+       if (curSel < 1)
+               ++curSel;
+       MoveSelection(0, curSel - 1, 0);
 }
 
 /// Get directories of first selected item
index 69e75e3..9dc39a4 100644 (file)
@@ -1,3 +1,7 @@
+2005-06-15 Kimmo
+ PATCH: [ 1220472 ] Don't lose selection when deleting items from dir compare
+  Src: DirActions.cpp
+
 2005-06-15 Perry
  PATCH: [ 1220416 ] error C2065: '_stat' : undeclared identifier
   Src: DirScan.cpp