break;
}
+ PathContext files1, files2;
+ GetItemFileNames(sel1, &files1);
+ GetItemFileNames(sel2, &files2);
+ paths.SetLeft(files1[nPane[0]]);
+ paths.SetRight(files2[nPane[1]]);
+
if (pdi[0]->diffcode.isDirectory())
{
isDir = true;
- if (GetPairComparability(PathContext(pathLeft, pathRight)) != IS_EXISTING_DIR)
+ if (GetPairComparability(paths) != IS_EXISTING_DIR)
{
LangMessageBox(IDS_INVALID_DIRECTORY, MB_ICONSTOP);
return false;
}
}
- PathContext files1, files2;
- GetItemFileNames(sel1, &files1);
- GetItemFileNames(sel2, &files2);
- paths.SetLeft(files1[nPane[0]]);
- paths.SetRight(files2[nPane[1]]);
-
return true;
}
GetItemFileNames(sel3, &pathsTemp);
pathRight = pathsTemp[2];
+ paths.SetLeft(pathLeft.c_str());
+ paths.SetMiddle(pathMiddle.c_str());
+ paths.SetRight(pathRight.c_str());
+
if (pdi[0]->diffcode.isDirectory())
{
isDir = true;
- if (GetPairComparability(PathContext(pathLeft, pathMiddle, pathRight)) != IS_EXISTING_DIR)
+ if (GetPairComparability(paths) != IS_EXISTING_DIR)
{
AfxMessageBox(IDS_INVALID_DIRECTORY, MB_ICONSTOP);
return false;
}
}
- paths.SetLeft(pathLeft.c_str());
- paths.SetRight(pathRight.c_str());
-
return true;
}
bool bRO[3] = { false, false, false };
int nPane[3];
- if (pDoc->m_nDirs < 3 && pos2)
+ if (pos2 && !pos3)
{
bool success = OpenTwoItems(selectionType, pos1, pos2, pdi,
paths, sel1, sel2, isdir, nPane);
if (!success)
return;
}
- else if (pDoc->m_nDirs == 3 && pos2)
+ else if (pos2 && pos3)
{
bool success = OpenThreeItems(pos1, pos2, pos3, pdi,
paths, sel1, sel2, sel3, isdir, nPane);
// Don't add folders to MRU
GetMainFrame()->DoFileOpen(&paths, dwFlags, pDoc->GetRecursive(), (GetAsyncKeyState(VK_CONTROL) & 0x8000) ? NULL : pDoc);
}
- else if (HasZipSupport() && std::count_if(paths.begin(), paths.end(), ArchiveGuessFormat) == pDoc->m_nDirs)
+ else if (HasZipSupport() && std::count_if(paths.begin(), paths.end(), ArchiveGuessFormat) == paths.GetSize())
{
// Open archives, not adding paths to MRU
GetMainFrame()->DoFileOpen(&paths, dwFlags, pDoc->GetRecursive(), NULL, _T(""), infoUnpacker);
// Open identical and different files
FileLocation fileloc[3];
- if (pDoc->m_nDirs < 3)
+ if (paths.GetSize() < 3)
{
theApp.m_strDescriptions[0].erase();
theApp.m_strDescriptions[1].erase();
fileloc[nIndex].setPath(paths[nIndex]);
fileloc[nIndex].encoding = pdi[nIndex]->diffFileInfo[nPane[nIndex]].encoding;
}
- GetMainFrame()->ShowAutoMergeDoc(pDoc, pDoc->m_nDirs, fileloc,
+ GetMainFrame()->ShowAutoMergeDoc(pDoc, paths.GetSize(), fileloc,
dwFlags, infoUnpacker);
}
}
const DIFFITEM& di1 = GetDiffItem(sel1);
const DIFFITEM& di2 = GetDiffItem(sel2);
const DIFFITEM& di3 = GetDiffItem(sel3);
- if (!AreItemsOpenable(di1, di2, di3))
+ if (selectionType != SELECTIONTYPE_NORMAL || !AreItemsOpenable(di1, di2, di3))
{
pCmdUI->Enable(FALSE);
return;
{
if (files.GetSize() == 3)
{
- AfxMessageBox(_T("3\83t\83H\83\8b\83_\94ä\8ar\8b@\94\\82Í\8eÀ\91\95\92\86\82Å\82·"), MB_ICONWARNING | MB_DONT_ASK_AGAIN);
+ AfxMessageBox(_T("3-way folder compare feature is in progress"), MB_ICONWARNING | MB_DONT_ASK_AGAIN);
}
// Anything that can go wrong inside InitCompare() will yield an
// exception. There is no point in checking return value.
/// Get pointer to a dir doc for displaying a scan
CDirDoc * CMainFrame::GetDirDocToShow(int nDirs, BOOL * pNew)
{
+ CDirDoc::m_nDirsTemp = nDirs;
if (!m_pMenus[MENU_DIRVIEW])
theApp.m_pDirTemplate->m_hMenuShared = NewDirViewMenu();
CDirDoc * pDirDoc = 0;
}
if (!pDirDoc)
{
- CDirDoc::m_nDirsTemp = nDirs;
pDirDoc = (CDirDoc*)theApp.m_pDirTemplate->OpenDocumentFile(NULL);
*pNew = TRUE;
}