diff --git a/Src/DirView.cpp b/Src/DirView.cpp index 651aabccb3d..2f68468532e 100644 --- a/Src/DirView.cpp +++ b/Src/DirView.cpp @@ -1415,15 +1415,13 @@ void CDirView::Open(CDirDoc *pDoc, const PathContext& paths, fileopenflags_t dwF } } - if (!infoUnpacker) - { - PrediffingInfo* infoPrediffer = nullptr; - String filteredFilenames = CDiffContext::GetFilteredFilenames(filteredPaths); - GetDiffContext().FetchPluginInfos(filteredFilenames, &infoUnpacker, &infoPrediffer); - } + PackingInfo* tmpInfoUnpacker = nullptr; + PrediffingInfo* infoPrediffer = nullptr; + String filteredFilenames = CDiffContext::GetFilteredFilenames(filteredPaths); + GetDiffContext().FetchPluginInfos(filteredFilenames, !infoUnpacker ? &infoUnpacker : &tmpInfoUnpacker, &infoPrediffer); GetMainFrame()->ShowAutoMergeDoc(0, GetDocument(), paths.GetSize(), fileloc, - dwFlags, strDesc, _T(""), infoUnpacker); + dwFlags, strDesc, _T(""), infoUnpacker, infoPrediffer); } } @@ -1595,19 +1593,19 @@ void CDirView::OpenSelectionAs(UINT id) } dwFlags[pane] |= FFILEOPEN_NOMRU | (pDoc->GetReadOnly(nPane[pane]) ? FFILEOPEN_READONLY : 0); } + PackingInfo* infoUnpacker = nullptr; + PrediffingInfo* infoPrediffer = nullptr; + GetDiffContext().FetchPluginInfos(CDiffContext::GetFilteredFilenames(filteredPaths), &infoUnpacker, &infoPrediffer); if (ID_UNPACKERS_FIRST <= id && id <= ID_UNPACKERS_LAST) { - PackingInfo infoUnpacker( + PackingInfo infoUnpackerAlt( CMainFrame::GetPluginPipelineByMenuId(id, FileTransform::UnpackerEventNames, ID_UNPACKERS_FIRST)); GetMainFrame()->DoFileOrFolderOpen(&paths, dwFlags, strDesc, _T(""), - ctxt.m_bRecursive, nullptr, &infoUnpacker, nullptr, 0); + ctxt.m_bRecursive, nullptr, &infoUnpackerAlt, infoPrediffer, 0); } else { - PackingInfo* infoUnpacker = nullptr; - PrediffingInfo* infoPrediffer = nullptr; - GetDiffContext().FetchPluginInfos(CDiffContext::GetFilteredFilenames(filteredPaths), &infoUnpacker, &infoPrediffer); - GetMainFrame()->ShowMergeDoc(id, pDoc, paths.GetSize(), fileloc, dwFlags, strDesc, _T(""), infoUnpacker); + GetMainFrame()->ShowMergeDoc(id, pDoc, paths.GetSize(), fileloc, dwFlags, strDesc, _T(""), infoUnpacker, infoPrediffer); } } diff --git a/Src/MainFrm.cpp b/Src/MainFrm.cpp index e1af5c239df..adb33489030 100644 --- a/Src/MainFrm.cpp +++ b/Src/MainFrm.cpp @@ -770,10 +770,9 @@ FileLocationGuessEncodings(FileLocation & fileloc, int iGuessEncoding) bool CMainFrame::ShowAutoMergeDoc(UINT nID, CDirDoc * pDirDoc, int nFiles, const FileLocation ifileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile /*= _T("")*/, - const PackingInfo * infoUnpacker /*= nullptr*/, const OpenFileParams* pOpenParams /*= nullptr*/) + const PackingInfo* infoUnpacker /*= nullptr*/, const PrediffingInfo* infoPrediffer /*= nullptr*/, + const OpenFileParams* pOpenParams /*= nullptr*/) { - ASSERT(pDirDoc != nullptr); - if (sReportFile.empty() && pDirDoc->CompareFilesIfFilesAreLarge(nFiles, ifileloc)) return false; @@ -799,60 +798,66 @@ bool CMainFrame::ShowAutoMergeDoc(UINT nID, CDirDoc * pDirDoc, for (int pane = 0; pane < nFiles; ++pane) { if (CWebPageDiffFrame::MatchURLPattern(ifileloc[pane].filepath)) - return ShowWebDiffDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, dynamic_cast(pOpenParams)); + return ShowWebDiffDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, infoPrediffer, dynamic_cast(pOpenParams)); String filepath = ifileloc[pane].filepath + unpackedFileExtension; if (filterImg.includeFile(filepath) && CImgMergeFrame::IsLoadable()) - return ShowImgMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, dynamic_cast(pOpenParams)); + return ShowImgMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, infoPrediffer, dynamic_cast(pOpenParams)); else if (filterBin.includeFile(filepath) && CHexMergeView::IsLoadable()) - return ShowHexMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, dynamic_cast(pOpenParams)); + return ShowHexMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, infoPrediffer, dynamic_cast(pOpenParams)); } switch (std::abs(static_cast(nID))) { case ID_MERGE_COMPARE_TEXT: return ShowTextMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, - strDesc, sReportFile, infoUnpacker, dynamic_cast(pOpenParams)); + strDesc, sReportFile, infoUnpacker, infoPrediffer, dynamic_cast(pOpenParams)); case ID_MERGE_COMPARE_TABLE: return ShowTableMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, - strDesc, sReportFile, infoUnpacker, dynamic_cast(pOpenParams)); + strDesc, sReportFile, infoUnpacker, infoPrediffer, dynamic_cast(pOpenParams)); case ID_MERGE_COMPARE_HEX: return ShowHexMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, - strDesc, sReportFile, infoUnpacker, dynamic_cast(pOpenParams)); + strDesc, sReportFile, infoUnpacker, infoPrediffer, dynamic_cast(pOpenParams)); case ID_MERGE_COMPARE_IMAGE: return ShowImgMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, - strDesc, sReportFile, infoUnpacker, dynamic_cast(pOpenParams)); + strDesc, sReportFile, infoUnpacker, infoPrediffer, dynamic_cast(pOpenParams)); case ID_MERGE_COMPARE_WEBPAGE: return ShowWebDiffDoc(pDirDoc, nFiles, ifileloc, dwFlags, - strDesc, sReportFile, infoUnpacker, dynamic_cast(pOpenParams)); + strDesc, sReportFile, infoUnpacker, infoPrediffer, dynamic_cast(pOpenParams)); default: - return ShowTextOrTableMergeDoc({}, pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, dynamic_cast(pOpenParams)); + return ShowTextOrTableMergeDoc({}, pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, infoPrediffer, dynamic_cast(pOpenParams)); } } bool CMainFrame::ShowMergeDoc(UINT nID, CDirDoc* pDirDoc, int nFiles, const FileLocation ifileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile /*= _T("")*/, - const PackingInfo* infoUnpacker /*= nullptr*/, const OpenFileParams* pOpenParams /*= nullptr*/) + const PackingInfo* infoUnpacker /*= nullptr*/, const PrediffingInfo* infoPrediffer /*= nullptr*/, + const OpenFileParams* pOpenParams /*= nullptr*/) { switch (nID) { case ID_MERGE_COMPARE_TEXT: return ShowTextMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, - strDesc, sReportFile, infoUnpacker, dynamic_cast(pOpenParams)); + strDesc, sReportFile, infoUnpacker, infoPrediffer, + dynamic_cast(pOpenParams)); case ID_MERGE_COMPARE_TABLE: return ShowTableMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, - strDesc, sReportFile, infoUnpacker, dynamic_cast(pOpenParams)); + strDesc, sReportFile, infoUnpacker, infoPrediffer, + dynamic_cast(pOpenParams)); case ID_MERGE_COMPARE_HEX: return ShowHexMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, - strDesc, sReportFile, infoUnpacker, dynamic_cast(pOpenParams)); + strDesc, sReportFile, infoUnpacker, infoPrediffer, + dynamic_cast(pOpenParams)); case ID_MERGE_COMPARE_IMAGE: return ShowImgMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags, - strDesc, sReportFile, infoUnpacker, dynamic_cast(pOpenParams)); + strDesc, sReportFile, infoUnpacker, infoPrediffer, + dynamic_cast(pOpenParams)); case ID_MERGE_COMPARE_WEBPAGE: return ShowWebDiffDoc(pDirDoc, nFiles, ifileloc, dwFlags, - strDesc, sReportFile, infoUnpacker, dynamic_cast(pOpenParams)); + strDesc, sReportFile, infoUnpacker, infoPrediffer, + dynamic_cast(pOpenParams)); default: return ShowAutoMergeDoc(nID, pDirDoc, nFiles, ifileloc, dwFlags, - strDesc, sReportFile, infoUnpacker, pOpenParams); + strDesc, sReportFile, infoUnpacker, infoPrediffer, pOpenParams); } } @@ -891,7 +896,8 @@ int GetActivePaneFromFlags(int nFiles, const fileopenflags_t dwFlags[]) bool CMainFrame::ShowTextOrTableMergeDoc(std::optional table, CDirDoc * pDirDoc, int nFiles, const FileLocation ifileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile /*= _T("")*/, - const PackingInfo * infoUnpacker /*= nullptr*/, const OpenTextFileParams* pOpenParams /*= nullptr*/) + const PackingInfo* infoUnpacker /*= nullptr*/, const PrediffingInfo* infoPrediffer /*= nullptr*/, + const OpenTextFileParams* pOpenParams /*= nullptr*/) { CMultiDocTemplate* pDiffTemplate = theApp.GetDiffTemplate(); if (m_pMenus[MENU_MERGEVIEW] == nullptr) @@ -911,6 +917,7 @@ bool CMainFrame::ShowTextOrTableMergeDoc(std::optional table, CDirDoc * pD // Warning : this unpacker may differ from the pDirDoc one // (through menu : "Plugins"->"Open with unpacker") pMergeDoc->SetUnpacker(infoUnpacker); + pMergeDoc->SetPrediffer(infoPrediffer); // detect codepage int iGuessEncodingType = GetOptionsMgr()->GetInt(OPT_CP_DETECT); @@ -989,22 +996,25 @@ bool CMainFrame::ShowTextOrTableMergeDoc(std::optional table, CDirDoc * pD bool CMainFrame::ShowTextMergeDoc(CDirDoc* pDirDoc, int nFiles, const FileLocation ifileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile /*= _T("")*/, - const PackingInfo* infoUnpacker /*= nullptr*/, const OpenTextFileParams* pOpenParams /*= nullptr*/) + const PackingInfo* infoUnpacker /*= nullptr*/, const PrediffingInfo* infoPrediffer /*= nullptr*/, + const OpenTextFileParams* pOpenParams /*= nullptr*/) { - return ShowTextOrTableMergeDoc(false, pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, pOpenParams); + return ShowTextOrTableMergeDoc(false, pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, infoPrediffer, pOpenParams); } bool CMainFrame::ShowTableMergeDoc(CDirDoc* pDirDoc, int nFiles, const FileLocation ifileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile /*= _T("")*/, - const PackingInfo* infoUnpacker /*= nullptr*/, const OpenTextFileParams* pOpenParams /*= nullptr*/) + const PackingInfo* infoUnpacker /*= nullptr*/, const PrediffingInfo* infoPrediffer /*= nullptr*/, + const OpenTextFileParams* pOpenParams /*= nullptr*/) { - return ShowTextOrTableMergeDoc(true, pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, pOpenParams); + return ShowTextOrTableMergeDoc(true, pDirDoc, nFiles, ifileloc, dwFlags, strDesc, sReportFile, infoUnpacker, infoPrediffer, pOpenParams); } bool CMainFrame::ShowHexMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile /*= _T("")*/, - const PackingInfo * infoUnpacker /*= nullptr*/, const OpenBinaryFileParams* pOpenParams /*= nullptr*/) + const PackingInfo* infoUnpacker /*= nullptr*/, const PrediffingInfo* infoPrediffer /*= nullptr*/, + const OpenBinaryFileParams* pOpenParams /*= nullptr*/) { CMultiDocTemplate* pHexMergeTemplate = theApp.GetHexMergeTemplate(); if (m_pMenus[MENU_HEXMERGEVIEW] == nullptr) @@ -1031,7 +1041,8 @@ bool CMainFrame::ShowHexMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocati bool CMainFrame::ShowImgMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile /*= _T("")*/, - const PackingInfo * infoUnpacker /*= nullptr*/, const OpenImageFileParams* pOpenParams /*= nullptr*/) + const PackingInfo* infoUnpacker /*= nullptr*/, const PrediffingInfo* infoPrediffer /*= nullptr*/, + const OpenImageFileParams* pOpenParams /*= nullptr*/) { CImgMergeFrame *pImgMergeFrame = new CImgMergeFrame(); if (!CImgMergeFrame::menu.m_hMenu) @@ -1063,7 +1074,8 @@ bool CMainFrame::ShowImgMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocati bool CMainFrame::ShowWebDiffDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile /*= _T("")*/, - const PackingInfo * infoUnpacker /*= nullptr*/, const OpenWebPageParams* pOpenParams /*= nullptr*/) + const PackingInfo* infoUnpacker /*= nullptr*/, const PrediffingInfo* infoPrediffer /*= nullptr*/, + const OpenWebPageParams* pOpenParams /*= nullptr*/) { CWebPageDiffFrame *pWebPageMergeFrame = new CWebPageDiffFrame(); if (!CWebPageDiffFrame::menu.m_hMenu) @@ -1097,8 +1109,6 @@ bool CMainFrame::ShowTextMergeDoc(CDirDoc* pDirDoc, int nBuffers, const String t { FileLocation fileloc[3]; fileopenflags_t dwFlags[3] = {}; - CDirDoc* pDirDoc2 = pDirDoc->GetMainView() ? pDirDoc : - static_cast(theApp.GetDirTemplate()->CreateNewDocument()); m_tempFiles.reserve(nBuffers); for (int nBuffer = 0; nBuffer < nBuffers; ++nBuffer) { @@ -1113,7 +1123,7 @@ bool CMainFrame::ShowTextMergeDoc(CDirDoc* pDirDoc, int nBuffers, const String t } fileloc[nBuffer].setPath(workFile); } - return ShowTextMergeDoc(pDirDoc2, nBuffers, fileloc, dwFlags, strDesc, _T(""), nullptr, pOpenParams); + return ShowTextMergeDoc(pDirDoc, nBuffers, fileloc, dwFlags, strDesc, _T(""), nullptr, nullptr, pOpenParams); } /** @@ -1399,10 +1409,6 @@ bool CMainFrame::DoFileOrFolderOpen(const PathContext * pFiles /*= nullptr*/, pDirTemplate->m_hMenuShared = NewDirViewMenu(); pDirDoc = static_cast(pDirTemplate->OpenDocumentFile(nullptr)); } - else - { - pDirDoc = static_cast(pDirTemplate->CreateNewDocument()); - } } // open the diff @@ -1433,14 +1439,8 @@ bool CMainFrame::DoFileOrFolderOpen(const PathContext * pFiles /*= nullptr*/, for (int nPane = 0; nPane < tFiles.GetSize(); nPane++) fileloc[nPane].setPath(tFiles[nPane]); - if (infoPrediffer && !infoPrediffer->GetPluginPipeline().empty()) - { - String strBothFilenames = strutils::join(tFiles.begin(), tFiles.end(), _T("|")); - pDirDoc->GetPluginManager().SetPrediffer(strBothFilenames, infoPrediffer->GetPluginPipeline()); - } - ShowMergeDoc(nID, pDirDoc, tFiles.GetSize(), fileloc, dwFlags, strDesc, sReportFile, - infoUnpacker, pOpenParams); + infoUnpacker, infoPrediffer, pOpenParams); } if (pFiles != nullptr && (!dwFlags || !(dwFlags[0] & FFILEOPEN_NOMRU))) @@ -1460,17 +1460,11 @@ bool CMainFrame::DoFileOpen(UINT nID, const PathContext* pFiles, const OpenFileParams *pOpenParams /*= nullptr*/) { ASSERT(pFiles != nullptr); - CDirDoc* pDirDoc = static_cast(theApp.GetDirTemplate()->CreateNewDocument()); FileLocation fileloc[3]; for (int pane = 0; pane < pFiles->GetSize(); pane++) fileloc[pane].setPath((*pFiles)[pane]); - if (infoPrediffer && !infoPrediffer->GetPluginPipeline().empty()) - { - String strBothFilenames = strutils::join(pFiles->begin(), pFiles->end(), _T("|")); - pDirDoc->GetPluginManager().SetPrediffer(strBothFilenames, infoPrediffer->GetPluginPipeline()); - } - bool result = ShowMergeDoc(nID, pDirDoc, pFiles->GetSize(), fileloc, - dwFlags, strDesc, sReportFile, infoUnpacker, pOpenParams); + bool result = ShowMergeDoc(nID, nullptr, pFiles->GetSize(), fileloc, + dwFlags, strDesc, sReportFile, infoUnpacker, infoPrediffer, pOpenParams); if (!dwFlags || !(dwFlags[0] & FFILEOPEN_NOMRU)) AddToRecentDocs(*pFiles, (unsigned *)dwFlags, strDesc, false, _T(""), infoUnpacker, infoPrediffer, nID, pOpenParams); return result; @@ -1790,7 +1784,7 @@ DocClass * GetMergeDocForDiff(CMultiDocTemplate *pTemplate, CDirDoc *pDirDoc, in // Create a new merge doc DocClass::m_nBuffersTemp = nFiles; DocClass *pMergeDoc = static_cast(pTemplate->OpenDocumentFile(nullptr, bMakeVisible)); - if (pMergeDoc != nullptr) + if (pMergeDoc != nullptr && pDirDoc != nullptr) { pDirDoc->AddMergeDoc(pMergeDoc); pMergeDoc->SetDirDoc(pDirDoc); @@ -2005,8 +1999,6 @@ bool CMainFrame::DoFileNew(UINT nID, int nPanes, const PrediffingInfo *infoPrediffer /*= nullptr*/, const OpenFileParams *pOpenParams) { - CDirDoc *pDirDoc = static_cast(theApp.GetDirTemplate()->CreateNewDocument()); - // Load emptyfile descriptors and open empty docs // Use default codepage FileLocation fileloc[3]; @@ -2028,9 +2020,7 @@ bool CMainFrame::DoFileNew(UINT nID, int nPanes, strDesc2[i] = strDesc[i]; fileloc[i].encoding.SetCodepage(ucr::getDefaultCodepage()); } - if (infoPrediffer && !infoPrediffer->GetPluginPipeline().empty()) - pDirDoc->GetPluginManager().SetPrediffer(_T("|"), infoPrediffer->GetPluginPipeline()); - return ShowMergeDoc(nID, pDirDoc, nPanes, fileloc, dwFlags, strDesc2, _T(""), nullptr, pOpenParams); + return ShowMergeDoc(nID, nullptr, nPanes, fileloc, dwFlags, strDesc2, _T(""), nullptr, infoPrediffer, pOpenParams); } /** diff --git a/Src/MainFrm.h b/Src/MainFrm.h index 5fbed9c6a2b..7d44b99ada2 100644 --- a/Src/MainFrm.h +++ b/Src/MainFrm.h @@ -170,30 +170,38 @@ class CMainFrame : public CMDIFrameWnd const OpenFileParams* pOpenParams = nullptr); bool ShowAutoMergeDoc(UINT nID, CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile = _T(""), - const PackingInfo * infoUnpacker = nullptr, const OpenFileParams *pOpenParams = nullptr); + const PackingInfo * infoUnpacker = nullptr, const PrediffingInfo * infoPrediffer = nullptr, + const OpenFileParams *pOpenParams = nullptr); bool ShowMergeDoc(UINT nID, CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile = _T(""), - const PackingInfo * infoUnpacker = nullptr, const OpenFileParams *pOpenParams = nullptr); + const PackingInfo * infoUnpacker = nullptr, const PrediffingInfo * infoPrediffer = nullptr, + const OpenFileParams *pOpenParams = nullptr); bool ShowTextOrTableMergeDoc(std::optional table, CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile = _T(""), - const PackingInfo * infoUnpacker = nullptr, const OpenTextFileParams *pOpenParams = nullptr); + const PackingInfo * infoUnpacker = nullptr, const PrediffingInfo * infoPrediffer = nullptr, + const OpenTextFileParams *pOpenParams = nullptr); bool ShowTextMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile = _T(""), - const PackingInfo * infoUnpacker = nullptr, const OpenTextFileParams *pOpenParams = nullptr); + const PackingInfo * infoUnpacker = nullptr, const PrediffingInfo * infoPrediffer = nullptr, + const OpenTextFileParams *pOpenParams = nullptr); bool ShowTextMergeDoc(CDirDoc* pDirDoc, int nBuffers, const String text[], const String strDesc[], const String& strFileExt, const OpenTextFileParams *pOpenParams = nullptr); bool ShowTableMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile = _T(""), - const PackingInfo * infoUnpacker = nullptr, const OpenTextFileParams *pOpenParams = nullptr); + const PackingInfo * infoUnpacker = nullptr, const PrediffingInfo * infoPrediffer = nullptr, + const OpenTextFileParams *pOpenParams = nullptr); bool ShowHexMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile = _T(""), - const PackingInfo * infoUnpacker = nullptr, const OpenBinaryFileParams *pOpenParams = nullptr); + const PackingInfo * infoUnpacker = nullptr, const PrediffingInfo * infoPrediffer = nullptr, + const OpenBinaryFileParams *pOpenParams = nullptr); bool ShowImgMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile = _T(""), - const PackingInfo * infoUnpacker = nullptr, const OpenImageFileParams *pOpenParams = nullptr); + const PackingInfo * infoUnpacker = nullptr, const PrediffingInfo * infoPrediffer = nullptr, + const OpenImageFileParams *pOpenParams = nullptr); bool ShowWebDiffDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[], const fileopenflags_t dwFlags[], const String strDesc[], const String& sReportFile = _T(""), - const PackingInfo * infoUnpacker = nullptr, const OpenWebPageParams *pOpenParams = nullptr); + const PackingInfo * infoUnpacker = nullptr, const PrediffingInfo * infoPrediffer = nullptr, + const OpenWebPageParams *pOpenParams = nullptr); void UpdateResources(); void ApplyDiffOptions(); diff --git a/Src/MergeDoc.cpp b/Src/MergeDoc.cpp index 71b686f0b03..ed82824d51d 100644 --- a/Src/MergeDoc.cpp +++ b/Src/MergeDoc.cpp @@ -3177,12 +3177,8 @@ bool CMergeDoc::OpenDocs(int nFiles, const FileLocation ifileloc[], } // Define the prediffer - PackingInfo * infoUnpacker = nullptr; - PrediffingInfo * infoPrediffer = nullptr; - if (bFiltersEnabled && m_pDirDoc != nullptr) + if (bFiltersEnabled) { - m_pDirDoc->GetPluginManager().FetchPluginInfos(m_strBothFilenames, &infoUnpacker, &infoPrediffer); - m_diffWrapper.SetPrediffer(infoPrediffer); m_diffWrapper.SetTextForAutomaticPrediff(m_strBothFilenames); }