From: Takashi Sawanaka Date: Sat, 22 Apr 2023 03:26:16 +0000 (+0900) Subject: Fix the problem that the /fr option is ignored when specifying the command line optio... X-Git-Tag: 2.16.30+jp-1~1^2~15 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=39ddfcd3a2064251f523de84474e08d9590f2d27;p=winmerge-jp%2Fwinmerge-jp.git Fix the problem that the /fr option is ignored when specifying the command line option /new --- diff --git a/Src/MainFrm.cpp b/Src/MainFrm.cpp index b759f9d46..e2be9d0f1 100644 --- a/Src/MainFrm.cpp +++ b/Src/MainFrm.cpp @@ -1974,7 +1974,8 @@ void CMainFrame::OnSaveConfigData() * @sa CMergeDoc::OpenDocs() * @sa CMergeDoc::TrySaveAs() */ -bool CMainFrame::DoFileNew(UINT nID, int nPanes, const String strDesc[], +bool CMainFrame::DoFileNew(UINT nID, int nPanes, + const fileopenflags_t dwFlags[], const String strDesc[], const PrediffingInfo *infoPrediffer /*= nullptr*/, const OpenFileParams *pOpenParams) { @@ -1982,7 +1983,6 @@ bool CMainFrame::DoFileNew(UINT nID, int nPanes, const String strDesc[], // Load emptyfile descriptors and open empty docs // Use default codepage - fileopenflags_t dwFlags[3] = {0, 0, 0}; FileLocation fileloc[3]; String strDesc2[3]; if (nPanes == 2) diff --git a/Src/MainFrm.h b/Src/MainFrm.h index edac4a661..02a55acbf 100644 --- a/Src/MainFrm.h +++ b/Src/MainFrm.h @@ -154,7 +154,8 @@ public: const String& sReportFile = _T(""), const PackingInfo* infoUnpacker = nullptr, const PrediffingInfo * infoPrediffer = nullptr, const OpenFileParams *pOpenParams = nullptr); - bool DoFileNew(UINT nID, int nPanes, const String strDesc[] = nullptr, + bool DoFileNew(UINT nID, int nPanes, + const fileopenflags_t dwFlags[] = nullptr, const String strDesc[] = nullptr, const PrediffingInfo * infoPrediffer = nullptr, const OpenFileParams *pOpenParams = nullptr); bool DoOpenConflict(const String& conflictFile, const String strDesc[] = nullptr, bool checked = false); diff --git a/Src/Merge.cpp b/Src/Merge.cpp index 2cfa13e0e..f6f2da300 100644 --- a/Src/Merge.cpp +++ b/Src/Merge.cpp @@ -881,7 +881,8 @@ bool CMergeApp::ParseArgsAndDoOpen(MergeCmdLineInfo& cmdInfo, CMainFrame* pMainF { if (cmdInfo.m_bNewCompare) { - bCompared = pMainFrame->DoFileNew(nID, 2, strDesc, infoPrediffer.get(), pOpenParams.get()); + fileopenflags_t dwFlags[3] = {cmdInfo.m_dwLeftFlags, cmdInfo.m_dwRightFlags, FFILEOPEN_NONE}; + bCompared = pMainFrame->DoFileNew(nID, 2, dwFlags, strDesc, infoPrediffer.get(), pOpenParams.get()); } else if (cmdInfo.m_bClipboardCompare) {