OSDN Git Service

PATCH: [ 1811745 ] Do not merge ignored differences (with multi selection)
authorKimmo Varis <kimmov@gmail.com>
Fri, 12 Oct 2007 14:14:12 +0000 (14:14 +0000)
committerKimmo Varis <kimmov@gmail.com>
Fri, 12 Oct 2007 14:14:12 +0000 (14:14 +0000)
Docs/Users/ChangeLog.txt
Src/MergeDoc.cpp

index 533857d..fd708d5 100644 (file)
@@ -6,6 +6,8 @@ WinMerge 2.7.5.4
   New folder compare column selection dialog (#1804555)\r
   Install WinMerge.exe (ANSI version) only for Windows 95/98/ME (#1809140)\r
   Better multi-monitor support, with option to lock panes (#1788168)\r
+  BugFix: Ignored differences were merged when merging multiple\r
+    differences (#1811745)\r
   Translation updates:\r
   - Chinese Traditional (#1810192, #1810541)\r
   - Italian (#1805044)\r
index eceb7a8..788e8d9 100644 (file)
@@ -765,6 +765,8 @@ void CMergeDoc::CopyAllList(int srcPane, int dstPane)
 
 /**
  * @brief Copy range of diffs from one side to side.
+ * This function copies given range of differences from side to another.
+ * Ignored differences are skipped, and not copied.
  * @param [in] srcPane Source side from which diff is copied
  * @param [in] dstPane Destination side
  * @param [in] firstDiff First diff copied (0-based index)
@@ -792,18 +794,21 @@ void CMergeDoc::CopyMultipleList(int srcPane, int dstPane, int firstDiff, int la
        // because we don't rescan() so it does not change
 
        SetCurrentDiff(lastDiff);
-       bool bGroupWithPrevious=false;
+       bool bGroupWithPrevious = false;
        if (!ListCopy(srcPane, dstPane, -1, bGroupWithPrevious))
                return; // sync failure
 
        // copy from bottom up is more efficient
-       for(int i = lastDiff - 1; i >= firstDiff; --i)
+       for (int i = lastDiff - 1; i >= firstDiff; --i)
        {
-               SetCurrentDiff(i);
-               // Group merge with previous (merge undo data to one action)
-               bGroupWithPrevious=true;
-               if (!ListCopy(srcPane, dstPane, -1, bGroupWithPrevious))
-                       return; // sync failure
+               if (m_diffList.IsDiffSignificant(i))
+               {
+                       SetCurrentDiff(i);
+                       // Group merge with previous (merge undo data to one action)
+                       bGroupWithPrevious = true;
+                       if (!ListCopy(srcPane, dstPane, -1, bGroupWithPrevious))
+                               return; // sync failure
+               }
        }
 
        suppressRescan.Clear(); // done suppress Rescan