OSDN Git Service

Add '/or reportfilename' command line option
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sun, 29 May 2016 10:04:37 +0000 (19:04 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sun, 29 May 2016 10:04:37 +0000 (19:04 +0900)
14 files changed:
Src/DirCmpReport.cpp
Src/DirCmpReport.h
Src/DirCmpReportDlg.cpp
Src/DirCmpReportDlg.h
Src/DirDoc.h
Src/DirView.cpp
Src/MainFrm.cpp
Src/MainFrm.h
Src/Merge.cpp
Src/Merge.h
Src/MergeCmdLineInfo.cpp
Src/MergeCmdLineInfo.h
Src/MergeDoc.cpp
Src/OpenView.cpp

index 37c0219..5be4434 100644 (file)
@@ -124,7 +124,10 @@ bool DirCmpReport::GenerateReport(String &errStr)
        bool bRet = false;
 
        DirCmpReportDlg dlg;
-       if (dlg.DoModal() == IDOK) try
+       dlg.LoadSettings();
+       dlg.m_sReportFile = m_sReportFile;
+
+       if (!m_sReportFile.empty() || dlg.DoModal() == IDOK) try
        {
                CWaitCursor waitstatus;
                if (dlg.m_bCopyToClipboard)
index 91b5708..bf2ca75 100644 (file)
@@ -38,6 +38,7 @@ public:
        explicit DirCmpReport(const std::vector<String>& colRegKeys);
        void SetList(IListCtrl *pList);
        void SetRootPaths(const PathContext &paths);
+       void SetReportFile(const String& sReportFile) { m_sReportFile = sReportFile; }
        void SetColumns(int columns);
        void SetFileCmpReport(IFileCmpReport *pFileCmpReport);
        bool GenerateReport(String &errStr);
@@ -58,6 +59,7 @@ private:
        IListCtrl * m_pList; /**< Pointer to UI-list */
        PathContext m_rootPaths; /**< Root paths, printed to report */
        String m_sTitle; /**< Report title, built from root paths */
+       String m_sReportFile;
        int m_nColumns; /**< Columns in UI */
        String m_sSeparator; /**< Column separator for report */
        CFile *m_pFile; /**< File to write report to */
index e6ae366..6a6e4a4 100644 (file)
@@ -82,6 +82,13 @@ static ReportTypeInfo f_types[] = {
        },
 };
 
+void DirCmpReportDlg::LoadSettings()
+{
+       m_nReportType = static_cast<REPORT_TYPE>(AfxGetApp()->GetProfileInt(_T("ReportFiles"), _T("ReportType"), 0));
+       m_bCopyToClipboard = !!AfxGetApp()->GetProfileInt(_T("ReportFiles"), _T("CopoyToClipboard"), false);
+       m_bIncludeFileCmpReport = !!AfxGetApp()->GetProfileInt(_T("ReportFiles"), _T("IncludeFileCmpReport"), false);
+}
+
 /**
  * @brief Dialog initializer function.
  */
@@ -89,10 +96,9 @@ BOOL DirCmpReportDlg::OnInitDialog()
 {
        CTrDialog::OnInitDialog();
 
+       LoadSettings();
+
        m_ctlReportFile.LoadState(_T("ReportFiles"));
-       m_nReportType = static_cast<REPORT_TYPE>(AfxGetApp()->GetProfileInt(_T("ReportFiles"), _T("ReportType"), 0));
-       m_bCopyToClipboard = !!AfxGetApp()->GetProfileInt(_T("ReportFiles"), _T("CopoyToClipboard"), false);
-       m_bIncludeFileCmpReport = !!AfxGetApp()->GetProfileInt(_T("ReportFiles"), _T("IncludeFileCmpReport"), false);
 
        for (int i = 0; i < sizeof(f_types) / sizeof(f_types[0]); ++i)
        {
index b4dc176..580e70f 100644 (file)
@@ -31,6 +31,8 @@ protected:
 
        DECLARE_MESSAGE_MAP()
 public:
+       void LoadSettings();
+
        // Generated message map functions
        //{{AFX_MSG(DirCmpReportDlg)
        afx_msg void OnBtnClickReportBrowse();
index 1ac6ccb..d5b90a7 100644 (file)
@@ -85,6 +85,8 @@ public:
        bool GetReadOnly(int nIndex) const;
        const bool *GetReadOnly(void) const;
        void SetReadOnly(int nIndex, bool bReadOnly);
+       String GetReportFile() const { return m_sReportFile; }
+       void SetReportFile(const String& sReportFile) { m_sReportFile = sReportFile; }
        bool HasDirView() const { return m_pDirView != NULL; }
        void RefreshOptions();
        void CompareReady();
@@ -131,6 +133,7 @@ private:
        MergeDocPtrList m_MergeDocs; /**< List of file compares opened from this compare */
        bool m_bRO[3]; /**< Is left/middle/right side read-only */
        String m_strDesc[3]; /**< Left/middle/right side desription text */
+       String m_sReportFile;
        PluginManager m_pluginman;
        bool m_bMarkedRescan; /**< If TRUE next rescan scans only marked items */
 };
index 999a344..ea9d422 100644 (file)
@@ -1190,7 +1190,7 @@ void CDirView::OpenParentDirectory()
                DWORD dwFlags[3];
                for (int nIndex = 0; nIndex < pathsParent.GetSize(); ++nIndex)
                        dwFlags[nIndex] = FFILEOPEN_NOMRU | (pDoc->GetReadOnly(nIndex) ? FFILEOPEN_READONLY : 0);
-               GetMainFrame()->DoFileOpen(&pathsParent, dwFlags, NULL, GetDiffContext().m_bRecursive, (GetAsyncKeyState(VK_CONTROL) & 0x8000) ? NULL : pDoc);
+               GetMainFrame()->DoFileOpen(&pathsParent, dwFlags, NULL, _T(""), GetDiffContext().m_bRecursive, (GetAsyncKeyState(VK_CONTROL) & 0x8000) ? NULL : pDoc);
        }
                // fall through (no break!)
        case AllowUpwardDirectory::No:
@@ -1324,12 +1324,12 @@ void CDirView::OpenSelection(SELECTIONTYPE selectionType /*= SELECTIONTYPE_NORMA
        {
                // Open subfolders
                // Don't add folders to MRU
-               GetMainFrame()->DoFileOpen(&paths, dwFlags, NULL, GetDiffContext().m_bRecursive, (GetAsyncKeyState(VK_CONTROL) & 0x8000) ? NULL : pDoc);
+               GetMainFrame()->DoFileOpen(&paths, dwFlags, NULL, _T(""), GetDiffContext().m_bRecursive, (GetAsyncKeyState(VK_CONTROL) & 0x8000) ? NULL : pDoc);
        }
        else if (HasZipSupport() && std::count_if(paths.begin(), paths.end(), ArchiveGuessFormat) == paths.GetSize())
        {
                // Open archives, not adding paths to MRU
-               GetMainFrame()->DoFileOpen(&paths, dwFlags, NULL, GetDiffContext().m_bRecursive, NULL, _T(""), infoUnpacker);
+               GetMainFrame()->DoFileOpen(&paths, dwFlags, NULL, _T(""), GetDiffContext().m_bRecursive, NULL, _T(""), infoUnpacker);
        }
        else
        {
@@ -1381,7 +1381,7 @@ void CDirView::OpenSelection(SELECTIONTYPE selectionType /*= SELECTIONTYPE_NORMA
                        fileloc[nIndex].encoding = pdi[nIndex]->diffFileInfo[nPane[nIndex]].encoding;
                }
                GetMainFrame()->ShowAutoMergeDoc(pDoc, paths.GetSize(), fileloc,
-                       dwFlags, strDesc, infoUnpacker);
+                       dwFlags, strDesc, _T(""), infoUnpacker);
        }
 }
 
@@ -2084,6 +2084,12 @@ LRESULT CDirView::OnUpdateUIMessage(WPARAM wParam, LPARAM lParam)
 
                Redisplay();
 
+               if (!pDoc->GetReportFile().empty())
+               {
+                       OnToolsGenerateReport();
+                       pDoc->SetReportFile(_T(""));
+               }
+
                if (GetOptionsMgr()->GetBool(OPT_SCROLL_TO_FIRST))
                        OnFirstdiff();
                else
@@ -2441,12 +2447,6 @@ private:
 void CDirView::OnToolsGenerateReport()
 {
        CDirDoc *pDoc = GetDocument();
-       if (!pDoc->HasDiffs())
-       {
-               // No items, no report
-               return;
-       }
-
        const CDiffContext& ctxt = GetDiffContext();
 
        // Make list of registry keys for columns
@@ -2470,11 +2470,15 @@ void CDirView::OnToolsGenerateReport()
        report.SetRootPaths(paths);
        report.SetColumns(m_pColItems->GetDispColCount());
        report.SetFileCmpReport(&freport);
+       report.SetReportFile(pDoc->GetReportFile());
        String errStr;
        if (report.GenerateReport(errStr))
        {
                if (errStr.empty())
-                       LangMessageBox(IDS_REPORT_SUCCESS, MB_OK | MB_ICONINFORMATION);
+               {
+                       if (pDoc->GetReportFile().empty())
+                               LangMessageBox(IDS_REPORT_SUCCESS, MB_OK | MB_ICONINFORMATION);
+               }
                else
                {
                        String msg = string_format_string1(
index 0fb1637..aa34f00 100644 (file)
@@ -624,7 +624,8 @@ FileLocationGuessEncodings(FileLocation & fileloc, int iGuessEncoding)
 
 bool CMainFrame::ShowAutoMergeDoc(CDirDoc * pDirDoc,
        int nFiles, const FileLocation ifileloc[],
-       const DWORD dwFlags[] /*=0*/, const String strDesc[], const PackingInfo * infoUnpacker /*= NULL*/)
+       const DWORD dwFlags[] /*=0*/, const String strDesc[], const String& sReportFile,
+       const PackingInfo * infoUnpacker /*= NULL*/)
 {
        int pane;
        FileFilterHelper filterImg, filterBin;
@@ -635,11 +636,11 @@ bool CMainFrame::ShowAutoMergeDoc(CDirDoc * pDirDoc,
        for (pane = 0; pane < nFiles; ++pane)
        {
                if (filterImg.includeFile(ifileloc[pane].filepath))
-                       return ShowImgMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, infoUnpacker);
+                       return ShowImgMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker);
                else if (filterBin.includeFile(ifileloc[pane].filepath))
-                       return ShowHexMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, infoUnpacker);
+                       return ShowHexMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker);
        }
-       return ShowMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, infoUnpacker);
+       return ShowMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker);
 }
 
 std::array<bool, 3> GetROFromFlags(int nFiles, const DWORD dwFlags[])
@@ -678,7 +679,8 @@ int GetActivePaneFromFlags(int nFiles, const DWORD dwFlags[])
  */
 bool CMainFrame::ShowMergeDoc(CDirDoc * pDirDoc,
        int nFiles, const FileLocation ifileloc[],
-       const DWORD dwFlags[], const String strDesc[], const PackingInfo * infoUnpacker /*= NULL*/)
+       const DWORD dwFlags[], const String strDesc[], const String& sReportFile,
+       const PackingInfo * infoUnpacker /*= NULL*/)
 {
        if (!m_pMenus[MENU_MERGEVIEW])
                theApp.m_pDiffTemplate->m_hMenuShared = NewMergeViewMenu();
@@ -736,42 +738,54 @@ bool CMainFrame::ShowMergeDoc(CDirDoc * pDirDoc,
        }
 
        // Note that OpenDocs() takes care of closing compare window when needed.
-       bool openResults = pMergeDoc->OpenDocs(nFiles, fileloc, GetROFromFlags(nFiles, dwFlags).data(), strDesc, GetActivePaneFromFlags(nFiles, dwFlags));
+       if (!pMergeDoc->OpenDocs(nFiles, fileloc, GetROFromFlags(nFiles, dwFlags).data(), strDesc, GetActivePaneFromFlags(nFiles, dwFlags)))
+               return false;
 
-       if (openResults == true)
+       for (int pane = 0; pane < nFiles; pane++)
        {
-               for (int pane = 0; pane < nFiles; pane++)
+               if (dwFlags)
                {
-                       if (dwFlags)
+                       BOOL bModified = (dwFlags[pane] & FFILEOPEN_MODIFIED) > 0;
+                       if (bModified)
+                       {
+                               pMergeDoc->m_ptBuf[pane]->SetModified(TRUE);
+                               pMergeDoc->UpdateHeaderPath(pane);
+                       }
+                       if (dwFlags[pane] & FFILEOPEN_AUTOMERGE)
                        {
-                               BOOL bModified = (dwFlags[pane] & FFILEOPEN_MODIFIED) > 0;
-                               if (bModified)
-                               {
-                                       pMergeDoc->m_ptBuf[pane]->SetModified(TRUE);
-                                       pMergeDoc->UpdateHeaderPath(pane);
-                               }
-                               if (dwFlags[pane] & FFILEOPEN_AUTOMERGE)
-                               {
-                                       pMergeDoc->DoAutoMerge(pane);
-                               }
+                               pMergeDoc->DoAutoMerge(pane);
                        }
                }
        }
-       return openResults;
+
+       if (!sReportFile.empty())
+               pMergeDoc->GenerateReport(sReportFile);
+
+       return true;
 }
 
 bool CMainFrame::ShowHexMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[],
-       const DWORD dwFlags[] /*=0*/, const String strDesc[], const PackingInfo * infoUnpacker /*= NULL*/)
+       const DWORD dwFlags[] /*=0*/, const String strDesc[], const String& sReportFile,
+       const PackingInfo * infoUnpacker /*= NULL*/)
 {
        if (!m_pMenus[MENU_HEXMERGEVIEW])
                theApp.m_pHexMergeTemplate->m_hMenuShared = NewHexMergeViewMenu();
-       if (CHexMergeDoc *pHexMergeDoc = GetMergeDocForDiff<CHexMergeDoc>(theApp.m_pHexMergeTemplate, pDirDoc, nFiles))
-               return pHexMergeDoc->OpenDocs(nFiles, fileloc, GetROFromFlags(nFiles, dwFlags).data(), strDesc, GetActivePaneFromFlags(nFiles, dwFlags));
-       return false;
+       CHexMergeDoc *pHexMergeDoc = GetMergeDocForDiff<CHexMergeDoc>(theApp.m_pHexMergeTemplate, pDirDoc, nFiles);
+       if (!pHexMergeDoc)
+               return false;
+
+       if (!pHexMergeDoc->OpenDocs(nFiles, fileloc, GetROFromFlags(nFiles, dwFlags).data(), strDesc, GetActivePaneFromFlags(nFiles, dwFlags)))
+               return false;
+       
+       if (!sReportFile.empty())
+               pHexMergeDoc->GenerateReport(sReportFile);
+
+       return true;
 }
 
 bool CMainFrame::ShowImgMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[],
-               const DWORD dwFlags[], const String strDesc[], const PackingInfo * infoUnpacker/* = NULL*/)
+       const DWORD dwFlags[], const String strDesc[], const String& sReportFile,
+       const PackingInfo * infoUnpacker/* = NULL*/)
 {
        CImgMergeFrame *pImgMergeFrame = new CImgMergeFrame();
        if (!CImgMergeFrame::menu.m_hMenu)
@@ -782,19 +796,18 @@ bool CMainFrame::ShowImgMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocati
        pDirDoc->AddMergeDoc(pImgMergeFrame);
                
        if (!pImgMergeFrame->OpenDocs(nFiles, fileloc, GetROFromFlags(nFiles, dwFlags).data(), strDesc, GetActivePaneFromFlags(nFiles, dwFlags), this))
+               return ShowMergeDoc(pDirDoc, nFiles, fileloc, dwFlags, strDesc, sReportFile, infoUnpacker);
+
+       for (int pane = 0; pane < nFiles; pane++)
        {
-               ShowMergeDoc(pDirDoc, nFiles, fileloc, dwFlags, strDesc, infoUnpacker);
-       }
-       else
-       {
-               for (int pane = 0; pane < nFiles; pane++)
-               {
-                       if (dwFlags[pane] & FFILEOPEN_AUTOMERGE)
-                               pImgMergeFrame->DoAutoMerge(pane);
-               }
+               if (dwFlags[pane] & FFILEOPEN_AUTOMERGE)
+                       pImgMergeFrame->DoAutoMerge(pane);
        }
 
-       return 0;
+       if (!sReportFile.empty())
+               pImgMergeFrame->GenerateReport(sReportFile);
+
+       return true;
 }
 
 /**
@@ -899,7 +912,7 @@ static bool AddToRecentDocs(const PathContext& paths, const unsigned flags[], bo
  * @return TRUE if opening files and compare succeeded, FALSE otherwise.
  */
 BOOL CMainFrame::DoFileOpen(const PathContext * pFiles /*=NULL*/,
-       const DWORD dwFlags[] /*=0*/, const String strDesc[], bool bRecurse /*=FALSE*/, CDirDoc *pDirDoc/*=NULL*/,
+       const DWORD dwFlags[] /*=0*/, const String strDesc[], const String& sReportFile, bool bRecurse /*=FALSE*/, CDirDoc *pDirDoc/*=NULL*/,
        String prediffer /*=_T("")*/, const PackingInfo *infoUnpacker/*=NULL*/)
 {
        if (pDirDoc && !pDirDoc->CloseMergeDocs())
@@ -1009,6 +1022,7 @@ BOOL CMainFrame::DoFileOpen(const PathContext * pFiles /*=NULL*/,
                        // exception. There is no point in checking return value.
                        pDirDoc->InitCompare(files, bRecurse, pTempPathContext);
 
+                       pDirDoc->SetReportFile(sReportFile);
                        pDirDoc->SetDescriptions(strDesc);
                        pDirDoc->SetTitle(NULL);
                        for (int nIndex = 0; nIndex < files.GetSize(); nIndex++)
@@ -1030,7 +1044,7 @@ BOOL CMainFrame::DoFileOpen(const PathContext * pFiles /*=NULL*/,
                        pDirDoc->GetPluginManager().SetPrediffer(strBothFilenames, prediffer);
                }
 
-               ShowAutoMergeDoc(pDirDoc, files.GetSize(), fileloc, dwFlags, strDesc,
+               ShowAutoMergeDoc(pDirDoc, files.GetSize(), fileloc, dwFlags, strDesc, sReportFile,
                                infoUnpacker);
        }
 
@@ -1406,7 +1420,7 @@ void CMainFrame::OnDropFiles(const std::vector<String>& dropped_files)
                }
        }
 
-       DoFileOpen(&files, dwFlags, NULL, recurse);
+       DoFileOpen(&files, dwFlags, NULL, _T(""), recurse);
 }
 
 void CMainFrame::OnPluginUnpackMode(UINT nID )
index 3955e47..84f3370 100644 (file)
@@ -99,15 +99,15 @@ public:
        void UpdatePrediffersMenu();
 
        BOOL DoFileOpen(const PathContext *pFiles = NULL,
-               const DWORD dwFlags[] = NULL, const String strDesc[] = NULL, bool bRecurse = false, CDirDoc *pDirDoc = NULL, String prediffer = _T(""), const PackingInfo * infoUnpacker = NULL);
+               const DWORD dwFlags[] = NULL, const String strDesc[] = NULL, const String& sReportFile = _T(""), bool bRecurse = false, CDirDoc *pDirDoc = NULL, String prediffer = _T(""), const PackingInfo * infoUnpacker = NULL);
        bool ShowAutoMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[],
-               const DWORD dwFlags[], const String strDesc[], const PackingInfo * infoUnpacker = NULL);
+               const DWORD dwFlags[], const String strDesc[], const String& sReportFile = _T(""), const PackingInfo * infoUnpacker = NULL);
        bool ShowMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[],
-               const DWORD dwFlags[], const String strDesc[], const PackingInfo * infoUnpacker = NULL);
+               const DWORD dwFlags[], const String strDesc[], const String& sReportFile = _T(""), const PackingInfo * infoUnpacker = NULL);
        bool ShowHexMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[],
-               const DWORD dwFlags[], const String strDesc[], const PackingInfo * infoUnpacker = NULL);
+               const DWORD dwFlags[], const String strDesc[], const String& sReportFile = _T(""), const PackingInfo * infoUnpacker = NULL);
        bool ShowImgMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[],
-               const DWORD dwFlags[], const String strDesc[], const PackingInfo * infoUnpacker = NULL);
+               const DWORD dwFlags[], const String strDesc[], const String& sReportFile = _T(""), const PackingInfo * infoUnpacker = NULL);
 
        void UpdateResources();
        void ClearStatusbarItemCount();
index db5ef79..fb3346b 100644 (file)
@@ -681,14 +681,14 @@ BOOL CMergeApp::ParseArgsAndDoOpen(MergeCmdLineInfo& cmdInfo, CMainFrame* pMainF
                        cmdInfo.m_dwRightFlags |= FFILEOPEN_CMDLINE;
                        DWORD dwFlags[3] = {cmdInfo.m_dwLeftFlags, cmdInfo.m_dwMiddleFlags, cmdInfo.m_dwRightFlags};
                        bCompared = pMainFrame->DoFileOpen(&cmdInfo.m_Files,
-                               dwFlags, strDesc, cmdInfo.m_bRecurse, NULL,
+                               dwFlags, strDesc, cmdInfo.m_sReportFile, cmdInfo.m_bRecurse, NULL,
                                cmdInfo.m_sPreDiffer);
                }
                else if (cmdInfo.m_Files.GetSize() > 1)
                {
                        DWORD dwFlags[3] = {cmdInfo.m_dwLeftFlags, cmdInfo.m_dwRightFlags, FFILEOPEN_NONE};
                        bCompared = pMainFrame->DoFileOpen(&cmdInfo.m_Files,
-                               dwFlags, strDesc, cmdInfo.m_bRecurse, NULL,
+                               dwFlags, strDesc, cmdInfo.m_sReportFile, cmdInfo.m_bRecurse, NULL,
                                cmdInfo.m_sPreDiffer);
                }
                else if (cmdInfo.m_Files.GetSize() == 1)
@@ -706,7 +706,7 @@ BOOL CMergeApp::ParseArgsAndDoOpen(MergeCmdLineInfo& cmdInfo, CMainFrame* pMainF
                        {
                                DWORD dwFlags[3] = {cmdInfo.m_dwLeftFlags, cmdInfo.m_dwRightFlags, FFILEOPEN_NONE};
                                bCompared = pMainFrame->DoFileOpen(&cmdInfo.m_Files,
-                                       dwFlags, strDesc, cmdInfo.m_bRecurse, NULL,
+                                       dwFlags, strDesc, cmdInfo.m_sReportFile, cmdInfo.m_bRecurse, NULL, 
                                        cmdInfo.m_sPreDiffer);
                        }
                }
@@ -1200,7 +1200,7 @@ bool CMergeApp::SaveProjectFile(const String& sProject, const ProjectFile &proje
  * @param [in] sProject Full path to project file.
  * @return TRUE if loading project file and starting compare succeeded.
  */
-bool CMergeApp::LoadAndOpenProjectFile(const String& sProject)
+bool CMergeApp::LoadAndOpenProjectFile(const String& sProject, const String& sReportFile)
 {
        ProjectFile project;
        if (!LoadProjectFile(sProject, project))
@@ -1246,7 +1246,7 @@ bool CMergeApp::LoadAndOpenProjectFile(const String& sProject)
 
        GetOptionsMgr()->SaveOption(OPT_CMP_INCLUDE_SUBDIRS, bRecursive);
        
-       BOOL rtn = GetMainFrame()->DoFileOpen(&files, dwFlags, NULL, bRecursive);
+       BOOL rtn = GetMainFrame()->DoFileOpen(&files, dwFlags, NULL, sReportFile, bRecursive);
 
        AddToRecentProjectsMRU(sProject.c_str());
        return !!rtn;
index 8dd7c3c..d016ece 100644 (file)
@@ -129,7 +129,7 @@ protected:
 
        bool LoadProjectFile(const String& sProject, ProjectFile &project);
        bool SaveProjectFile(const String& sProject, const ProjectFile &project);
-       bool LoadAndOpenProjectFile(const String& sFilepath);
+       bool LoadAndOpenProjectFile(const String& sFilepath, const String& sReportFile = _T(""));
        bool IsProjectFile(const String& filepath) const;
 
        //@{
index bf33ddf..924fe4f 100644 (file)
@@ -273,6 +273,11 @@ void MergeCmdLineInfo::ParseWinMergeCmdLine(const TCHAR *q)
                        // -o "outputfilename"
                        q = EatParam(q, m_sOutputpath);
                }
+               else if (param == _T("or"))
+               {
+                       // -or "reportfilename"
+                       q = EatParam(q, m_sReportFile);
+               }
                else if (param == _T("dl"))
                {
                        // -dl "desc" - description for left file
index 6c563fe..d69c287 100644 (file)
@@ -82,6 +82,7 @@ public:
        String m_sPreDiffer; /**< Pre-differ name. */
 
        String m_sOutputpath;
+       String m_sReportFile;
 
        PathContext m_Files; /**< Files (or directories) to compare. */
 
index cb5c90a..397a9a2 100644 (file)
@@ -2987,7 +2987,7 @@ bool CMergeDoc::OpenWithUnpackerDialog()
                if (HasZipSupport() && std::count_if(m_filePaths.begin(), m_filePaths.end(), ArchiveGuessFormat) == m_nBuffers)
                {
                        DWORD dwFlags[3] = {FFILEOPEN_NOMRU, FFILEOPEN_NOMRU, FFILEOPEN_NOMRU};
-                       GetMainFrame()->DoFileOpen(&m_filePaths, dwFlags, m_strDesc, 
+                       GetMainFrame()->DoFileOpen(&m_filePaths, dwFlags, m_strDesc, _T(""), 
                                GetOptionsMgr()->GetBool(OPT_CMP_INCLUDE_SUBDIRS), NULL, _T(""), &infoUnpacker);
                        CloseNow();
                }
index 3c80de2..dafb89a 100644 (file)
@@ -527,7 +527,8 @@ void COpenView::OnOK()
                GetParentFrame()->PostMessage(WM_CLOSE);
 
        GetMainFrame()->DoFileOpen(
-               &PathContext(pDoc->m_files), &std::vector<DWORD>(pDoc->m_dwFlags, pDoc->m_dwFlags + 3)[0], NULL, !!pDoc->m_bRecurse, NULL, _T(""), &PackingInfo(pDoc->m_infoHandler));
+               &PathContext(pDoc->m_files), &std::vector<DWORD>(pDoc->m_dwFlags, pDoc->m_dwFlags + 3)[0], 
+               NULL, _T(""), !!pDoc->m_bRecurse, NULL, _T(""), &PackingInfo(pDoc->m_infoHandler));
 }
 
 /**