assert(m_pList != nullptr);
assert(m_pFile == nullptr);
bool bRet = false;
-
- if (!m_sReportFile.empty()) try
+ try
{
if (m_bCopyToClipboard)
{
return false;
CSharedFile file(GMEM_DDESHARE|GMEM_MOVEABLE|GMEM_ZEROINIT);
m_pFile = &file;
+ bool savedIncludeFileCmpReport = m_bIncludeFileCmpReport;
+ m_bIncludeFileCmpReport = false;
GenerateReport(m_nReportType);
HGLOBAL hMem = file.Detach();
SetClipboardData(CF_UNICODETEXT, ConvertToUTF16ForClipboard(hMem, m_bOutputUTF8 ? CP_UTF8 : CP_THREAD_ACP));
SetClipboardData(CF_HTML, GlobalReAlloc(file.Detach(), size, 0));
}
CloseClipboard();
+ m_bIncludeFileCmpReport = savedIncludeFileCmpReport;
}
if (!m_sReportFile.empty())
{
}
if (!xml)
WriteString(_T("</table>\n"));
- if (m_myStruct)
- m_myStruct->context->m_pCompareStats->SetCompareState(CompareStats::STATE_IDLE);
}
/**
void SetList(IListCtrl *pList);
void SetRootPaths(const PathContext &paths);
void SetReportType(REPORT_TYPE nReportType) { m_nReportType = nReportType; }
+ REPORT_TYPE GetReportType() const { return m_nReportType; }
void SetReportFile(const String& sReportFile) { m_sReportFile = sReportFile; }
+ String GetReportFile() const { return m_sReportFile; }
void SetColumns(int columns);
void SetFileCmpReport(IFileCmpReport *pFileCmpReport);
void SetCopyToClipboard(bool bCopyToClipbard) { m_bCopyToClipboard = bCopyToClipbard; }
+ bool GetCopyToClipboard() const { return m_bCopyToClipboard; }
void SetIncludeFileCmpReport(bool bIncludeFileCmpReport) { m_bIncludeFileCmpReport = bIncludeFileCmpReport; }
+ bool GetIncludeFileCmpReport() const { return m_bIncludeFileCmpReport; }
void SetDiffFuncStruct(DiffFuncStruct* myStruct) { m_myStruct = myStruct; }
bool GenerateReport(String &errStr);
if (m_bGeneratingReport)
{
m_diffThread.SetCollectFunction([&](DiffFuncStruct* myStruct) {
+ int m = 0;
+ if (m_pReport->GetCopyToClipboard())
+ {
+ ++m;
+ if (m_pReport->GetReportType() == REPORT_TYPE_SIMPLEHTML)
+ ++m;
+ }
+ if (!m_pReport->GetReportFile().empty())
+ ++m;
myStruct->context->m_pCompareStats->IncreaseTotalItems(
- m_pDirView->GetListCtrl().GetItemCount() - (myStruct->context->m_bRecursive ? 0 : 1));
+ (m_pDirView->GetListCtrl().GetItemCount() - (myStruct->context->m_bRecursive ? 0 : 1)) * m);
});
m_diffThread.SetCompareFunction([&](DiffFuncStruct* myStruct) {
m_pReport->SetDiffFuncStruct(myStruct);