OSDN Git Service

[ 692922 ] Don't try to compare file & directory
authorKimmo Varis <kimmov@gmail.com>
Wed, 26 Feb 2003 13:30:38 +0000 (13:30 +0000)
committerKimmo Varis <kimmov@gmail.com>
Wed, 26 Feb 2003 13:30:38 +0000 (13:30 +0000)
Src/OpenDlg.cpp
Src/readme.txt

index 9706e1b..1f5854b 100644 (file)
@@ -209,10 +209,20 @@ BOOL COpenDlg::OnInitDialog()
 void COpenDlg::UpdateButtonStates()
 {
        BOOL bLIsDir, bRIsDir;
+       BOOL bLeftOk, bRightOk;
+       BOOL bEnableOK = FALSE;
        UpdateData(TRUE);
 
-       // only enable OK button if both file exist
-       BOOL bEnableOK = (IsFileOk(m_strLeft, &bLIsDir) && IsFileOk(m_strRight, &bRIsDir));
+       // Only enable OK button if both are exixting files or
+       // both are existing directories
+       bLeftOk = IsFileOk(m_strLeft, &bLIsDir);
+       bRightOk = IsFileOk(m_strRight, &bRIsDir);
+
+       if (bLeftOk && bRightOk)
+       {       
+               if ((bLIsDir && bRIsDir) || (!bLIsDir && !bRIsDir))
+                       bEnableOK = TRUE;
+       }
        m_ctlOk.EnableWindow(bEnableOK);
        m_ctlRecurse.EnableWindow(bEnableOK && bLIsDir && bRIsDir);
 }
index f1707ba..7fd0fa1 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-26 Kimmo
+ [ 692922 ] Don't try to compare file & directory
+  WinMerge:
+   OpenDlg.cpp
+
 2003-02-24 Kimmo
  [ 687574 ] Navigate in directory view (fix bug in patch)
   WinMerge:
@@ -6,7 +11,6 @@
   WinMerge:  
    MergeDoc.h Mergedoc.cpp
 
-
 2003-02-22 Perry
  [ 650356 ] suggest commenting out several functions
  [ 684416 ] is_all_whitespace is bad