Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.
Close

#1825 Location pane doesn't show any differences

Trunk
closed-fixed
GUI (515)
6
2009-01-06
2008-12-22
Kimmo Varis
No

WinMerge experimental release 2.11.1.8.

When two attached files are compared, the location pane doesn't show any differences.

To reproduce:
1) unzip two folders in the zip
2) compare folders in WinMerge, so that Folder1 is in left and Folder2 in right side
3) Open the files in folder compare to file compare

Expected:
Files have few differences, location pane shows the difference map.

Actual:
Location pane is empty. Refreshing, reloading etc don't help.

I've debugged this a bit and it seems the first difference in diff list is weird. end0 and blank1 are 0xFFFFFFFFF. Then when we ask flags etc using those values as linenumbers...

I've no yet idea why such values get added to diffitem.

Discussion

  • Kimmo Varis

    Kimmo Varis - 2008-12-22

    Files for reproducing the bug

     
  • Kimmo Varis

    Kimmo Varis - 2008-12-22

    Those 0xFFFFFFFFF values are of course -1:s set as default values... So now we need to learn location pane to check/recognize them.

     
  • Kimmo Varis

    Kimmo Varis - 2008-12-22

    blank1 (or blank0) being default is easy to handle. But what do when end0 is default? Which must mean that there are no diff (text) lines in that side. Hmm..

     
  • Kimmo Varis

    Kimmo Varis - 2008-12-22

    Hmm. It appears just fixing blankX values is enough to fix this bug. As endX values are not used by the code, but mapped dendX values.

    This patch fixes the bug for me (also attached):

    Index: Src/LocationView.cpp

    --- Src/LocationView.cpp (revision 6224)
    +++ Src/LocationView.cpp (working copy)
    @@ -297,7 +297,13 @@
    block.bottom_coord = nEndY;
    block.diff_index = nDiff;
    m_diffBlocks.push_back(block);
    - }
    + }
    +
    + // First diff having only blank lines in other side causes the
    + // blank value be -1. Set it to 0 as top line of diff.
    + if (diff.blank0 == -1)
    + diff.blank0 = 0;
    +
    // Now the block for blank lines side0!
    CalculateBlocksPixel(
    pView->GetSubLineIndex(diff.blank0),
    @@ -329,6 +335,12 @@
    block.diff_index = nDiff;
    m_diffBlocks.push_back(block);
    }
    +
    + // First diff having only blank lines in other side causes the
    + // blank value be -1. Set it to 0 as top line of diff.
    + if (diff.blank1 == -1)
    + diff.blank1 = 0;
    +
    // Now the block for blank lines side1!
    CalculateBlocksPixel(
    pView->GetSubLineIndex(diff.blank1),

    File Added: FixBlankLocationPane.patch

     
  • Kimmo Varis

    Kimmo Varis - 2008-12-22
    • assigned_to: nobody --> kimmov
     
  • Kimmo Varis

    Kimmo Varis - 2008-12-23

    Committed the fix to SVN trunk:
    Completed: At revision: 6232

     
  • Kimmo Varis

    Kimmo Varis - 2008-12-23
    • status: open --> open-accepted
     
  • Kimmo Varis

    Kimmo Varis - 2009-01-06

    Committed to 2.12 branch:
    Completed: At revision: 6287

     
  • Kimmo Varis

    Kimmo Varis - 2009-01-06
    • status: open-accepted --> closed-fixed
     

Log in to post a comment.