MCPcopy Create free account
hub / github.com/WinMerge/winmerge / OnToolsGenerateReport

Method OnToolsGenerateReport

Src/DirView.cpp:3150–3182  ·  view source on GitHub ↗

* @brief Generate report from dir compare results. */

Source from the content-addressed store, hash-verified

3148 * @brief Generate report from dir compare results.
3149 */
3150void CDirView::OnToolsGenerateReport()
3151{
3152 CDirDoc *pDoc = GetDocument();
3153 DirCmpReportDlg dlg;
3154 dlg.LoadSettings();
3155 dlg.m_sReportFile = pDoc->GetReportFile();
3156 if (dlg.m_sReportFile.empty() && dlg.DoModal() != IDOK)
3157 return;
3158
3159 pDoc->SetGeneratingReport(true);
3160 const CDiffContext& ctxt = GetDiffContext();
3161
3162 PathContext paths = ctxt.GetNormalizedPaths();
3163
3164 // If inside archive, convert paths
3165 if (pDoc->IsArchiveFolders())
3166 {
3167 for (int i = 0; i < paths.GetSize(); i++)
3168 pDoc->ApplyDisplayRoot(i, paths[i]);
3169 }
3170
3171 DirCmpReport *pReport = new DirCmpReport(GetCurrentColRegKeys());
3172 pReport->SetRootPaths(paths);
3173 pReport->SetColumns(m_pColItems->GetDispColCount());
3174 pReport->SetFileCmpReport(new FileCmpReport(this));
3175 pReport->SetList(new IListCtrlImpl(m_pList->m_hWnd, m_listViewItems));
3176 pReport->SetReportType(dlg.m_nReportType);
3177 pReport->SetReportFile(dlg.m_sReportFile);
3178 pReport->SetCopyToClipboard(dlg.m_bCopyToClipboard);
3179 pReport->SetIncludeFileCmpReport(dlg.m_bIncludeFileCmpReport);
3180 pDoc->SetReport(pReport);
3181 pDoc->Rescan();
3182}
3183
3184/**
3185 * @brief Generate patch from files selected.

Callers

nothing calls this directly

Calls 15

SetGeneratingReportMethod · 0.80
GetNormalizedPathsMethod · 0.80
IsArchiveFoldersMethod · 0.80
ApplyDisplayRootMethod · 0.80
SetRootPathsMethod · 0.80
SetColumnsMethod · 0.80
GetDispColCountMethod · 0.80
SetFileCmpReportMethod · 0.80
SetReportTypeMethod · 0.80
SetCopyToClipboardMethod · 0.80
SetReportMethod · 0.80

Tested by

no test coverage detected