OSDN Git Service

2005-11-05 Perry
authorPerry Rapp <elsapo@users.sourceforge.net>
Sat, 5 Nov 2005 00:06:53 +0000 (00:06 +0000)
committerPerry Rapp <elsapo@users.sourceforge.net>
Sat, 5 Nov 2005 00:06:53 +0000 (00:06 +0000)
 PATCH: [ 1337905 ] Allow comparing binary files with binary unpacker
  Src: DirView.cpp

Src/Changes.txt
Src/DirView.cpp

index 05590b6..fb1beaf 100644 (file)
@@ -1,3 +1,7 @@
+2005-11-05 Perry
+ PATCH: [ 1337905 ] Allow comparing binary files with binary unpacker
+  Src: DirView.cpp
+
 2005-11-04 Perry
  PATCH: [ 1335072 ] Add text to Plugins.txt to cover DisplayXMLFiles
   Plugins/dlls: Plugins.txt
index 83d6ff2..df76d2f 100644 (file)
@@ -870,6 +870,19 @@ bool CDirView::GetSelectedItems(int * sel1, int * sel2)
 }
 
 /**
+ * @brief Return true if this unpacker handles binary files
+ */
+static bool
+IsBinaryUnpacker(PackingInfo * infoUnpacker)
+{
+       if (!infoUnpacker)
+               return false;
+       if (!_tcsstr(infoUnpacker->pluginName, _T("BinaryFile")))
+               return false;
+       return true;
+}
+
+/**
  * @brief Open selected files or directories.
  *
  * Opens selected files to file compare. If comparing
@@ -1021,8 +1034,11 @@ void CDirView::OpenSelection(PackingInfo * infoUnpacker /*= NULL*/)
 
                if (di1->isBin() || di2->isBin())
                {
-                       AfxMessageBox(IDS_FILEBINARY, MB_ICONSTOP);
-                       return;
+                       if (!IsBinaryUnpacker(infoUnpacker))
+                       {
+                               AfxMessageBox(IDS_FILEBINARY, MB_ICONSTOP);
+                               return;
+                       }
                }
 
                // Close open documents first (ask to save unsaved data)