OSDN Git Service

BUG: [ 1488797 ] ASSERT in CMergeEditView::OnPrevdiff
authorKimmo Varis <kimmov@gmail.com>
Wed, 24 May 2006 20:39:40 +0000 (20:39 +0000)
committerKimmo Varis <kimmov@gmail.com>
Wed, 24 May 2006 20:39:40 +0000 (20:39 +0000)
 - fix from Mallato

Src/Changes.txt
Src/MergeEditView.cpp

index df1771a..a8ec597 100644 (file)
@@ -12,6 +12,9 @@ Add new items to top.
   Src/Languages/Swedish: MergeSwedish.rc
  Add some const keywords and fix comments, remove unused function.
   Src: DiffList.cpp DiffList.h
+ BUG: [ 1488797 ] ASSERT in CMergeEditView::OnPrevdiff
+  Fix from Mallato
+  Src: MergeEditView.cpp
 
 2006-05-23 Tim
  PATCH: [ 1493713 ] Translate 'Bookmarks' feature to German
index f8c2ca1..41e2c93 100644 (file)
@@ -899,10 +899,11 @@ void CMergeEditView::OnNextdiff()
                        if (curDiff < pd->m_diffList.GetSize() - 1)
                        {
                                nextDiff = pd->m_diffList.NextSignificantDiff(curDiff);
-                               if (nextDiff == -1)
-                                       nextDiff = curDiff;
                        }
                }
+               if (nextDiff == -1)
+                       nextDiff = curDiff;
+
                // nextDiff is the next one if there is one, else it is the one we're on
                SelectDiff(nextDiff, TRUE, FALSE);
        }
@@ -982,10 +983,11 @@ void CMergeEditView::OnPrevdiff()
                        if (curDiff > 0)
                        {
                                prevDiff = pd->m_diffList.PrevSignificantDiff(curDiff);
-                               if (prevDiff == -1)
-                                       prevDiff = curDiff;
                        }
                }
+               if (prevDiff == -1)
+                       prevDiff = curDiff;
+
                // prevDiff is the preceding one if there is one, else it is the one we're on
                SelectDiff(prevDiff, TRUE, FALSE);
        }