From b3ee244bad52301971feb4aabd8ff97f4b0b8f9f Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Sat, 15 May 2021 15:15:53 +0900 Subject: [PATCH] theApp is unnecessary because these methods are a static methods --- Src/DirView.cpp | 2 +- Src/FileActionScript.cpp | 2 +- Src/FileFiltersDlg.cpp | 2 +- Src/HexMergeView.cpp | 4 ++-- Src/ImgMergeFrm.cpp | 4 ++-- Src/MainFrm.cpp | 2 +- Src/Merge.cpp | 2 +- Src/MergeDoc.cpp | 4 ++-- Src/MergeEditView.cpp | 2 +- Src/PatchTool.cpp | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Src/DirView.cpp b/Src/DirView.cpp index a9c7ce2a2..a4e531248 100644 --- a/Src/DirView.cpp +++ b/Src/DirView.cpp @@ -1791,7 +1791,7 @@ void CDirView::DoOpenWithEditor(SIDE_TYPE stype) String file = GetSelectedFileName(dirBegin, stype, GetDiffContext()); if (file.empty()) return; - theApp.OpenFileToExternalEditor(file); + CMergeApp::OpenFileToExternalEditor(file); } void CDirView::DoOpenParentFolder(SIDE_TYPE stype) diff --git a/Src/FileActionScript.cpp b/Src/FileActionScript.cpp index 20afc2a42..7cbc6164c 100644 --- a/Src/FileActionScript.cpp +++ b/Src/FileActionScript.cpp @@ -82,7 +82,7 @@ int FileActionScript::CreateOperationsScripts() { if (bContinue) { - if (!theApp.CreateBackup(true, (*iter).dest)) + if (!CMergeApp::CreateBackup(true, (*iter).dest)) { String strErr = _("Error backing up file"); AfxMessageBox(strErr.c_str(), MB_OK | MB_ICONERROR); diff --git a/Src/FileFiltersDlg.cpp b/Src/FileFiltersDlg.cpp index 6d922d07a..469a97400 100644 --- a/Src/FileFiltersDlg.cpp +++ b/Src/FileFiltersDlg.cpp @@ -235,7 +235,7 @@ void FileFiltersDlg::OnFiltersEditbtn() */ void FileFiltersDlg::EditFileFilter(const String& path) { - theApp.OpenFileToExternalEditor(path); + CMergeApp::OpenFileToExternalEditor(path); } /** diff --git a/Src/HexMergeView.cpp b/Src/HexMergeView.cpp index 78f36c413..f5a3114e3 100644 --- a/Src/HexMergeView.cpp +++ b/Src/HexMergeView.cpp @@ -309,11 +309,11 @@ HRESULT CHexMergeView::SaveFile(LPCTSTR path) // Ask user what to do about FILE_ATTRIBUTE_READONLY String strPath = path; bool bApplyToAll = false; - if (theApp.HandleReadonlySave(strPath, false, bApplyToAll) == IDCANCEL) + if (CMergeApp::HandleReadonlySave(strPath, false, bApplyToAll) == IDCANCEL) return S_OK; path = strPath.c_str(); // Take a chance to create a backup - if (!theApp.CreateBackup(false, path)) + if (!CMergeApp::CreateBackup(false, path)) return S_OK; // Write data to an intermediate file String tempPath = env::GetTemporaryPath(); diff --git a/Src/ImgMergeFrm.cpp b/Src/ImgMergeFrm.cpp index 5749f5991..0d1c7ce0f 100644 --- a/Src/ImgMergeFrm.cpp +++ b/Src/ImgMergeFrm.cpp @@ -688,9 +688,9 @@ bool CImgMergeFrame::DoFileSave(int pane) { String filename = ucr::toTString(m_pImgMergeWindow->GetFileName(pane)); bool bApplyToAll = false; - if (theApp.HandleReadonlySave(filename, false, bApplyToAll) == IDCANCEL) + if (CMergeApp::HandleReadonlySave(m_filePaths[pane], false, bApplyToAll) == IDCANCEL) return false; - theApp.CreateBackup(false, filename); + CMergeApp::CreateBackup(false, m_filePaths[pane]); if (!m_pImgMergeWindow->SaveImage(pane)) { String str = strutils::format_string2(_("Saving file failed.\n%1\n%2\nDo you want to:\n\t- use a different filename (Press OK)\n\t- abort the current operation (Press Cancel)?"), filename, GetSysError()); diff --git a/Src/MainFrm.cpp b/Src/MainFrm.cpp index 09f0bca4c..8c4550aa8 100644 --- a/Src/MainFrm.cpp +++ b/Src/MainFrm.cpp @@ -1639,7 +1639,7 @@ void CMainFrame::OnSaveConfigData() if (configLog.WriteLogFile(sError)) { String sFileName = configLog.GetFileName(); - theApp.OpenFileToExternalEditor(sFileName); + CMergeApp::OpenFileToExternalEditor(sFileName); } else { diff --git a/Src/Merge.cpp b/Src/Merge.cpp index 36c8aa66c..88eed476c 100644 --- a/Src/Merge.cpp +++ b/Src/Merge.cpp @@ -456,7 +456,7 @@ BOOL CMergeApp::InitInstance() static void OpenContributersFile(int&) { - theApp.OpenFileToExternalEditor(paths::ConcatPath(env::GetProgPath(), ContributorsPath)); + CMergeApp::OpenFileToExternalEditor(paths::ConcatPath(env::GetProgPath(), ContributorsPath)); } static void OpenUrl(int&) diff --git a/Src/MergeDoc.cpp b/Src/MergeDoc.cpp index 75412ec3b..6e61af22b 100644 --- a/Src/MergeDoc.cpp +++ b/Src/MergeDoc.cpp @@ -1680,11 +1680,11 @@ bool CMergeDoc::DoSave(LPCTSTR szPath, bool &bSaveSuccess, int nBuffer) strSavePath = theApp.m_strSaveAsPath; } - nRetVal = theApp.HandleReadonlySave(strSavePath, false, bApplyToAll); + nRetVal = CMergeApp::HandleReadonlySave(strSavePath, false, bApplyToAll); if (nRetVal == IDCANCEL) return false; - if (!theApp.CreateBackup(false, strSavePath)) + if (!CMergeApp::CreateBackup(false, strSavePath)) return false; // false as long as the user is not satisfied diff --git a/Src/MergeEditView.cpp b/Src/MergeEditView.cpp index b6fc7558a..f5e86e65e 100644 --- a/Src/MergeEditView.cpp +++ b/Src/MergeEditView.cpp @@ -3889,7 +3889,7 @@ void CMergeEditView::OnOpenFileWithEditor() return; int nRealLine = ComputeRealLine(GetCursorPos().y) + 1; - theApp.OpenFileToExternalEditor(sFileName, nRealLine); + CMergeApp::OpenFileToExternalEditor(sFileName, nRealLine); } /** diff --git a/Src/PatchTool.cpp b/Src/PatchTool.cpp index ddfa1a787..d029b7a5a 100644 --- a/Src/PatchTool.cpp +++ b/Src/PatchTool.cpp @@ -193,7 +193,7 @@ int CPatchTool::CreatePatch() if (retVal) { if (m_bOpenToEditor) - theApp.OpenFileToExternalEditor(m_sPatchFile); + CMergeApp::OpenFileToExternalEditor(m_sPatchFile); } return retVal; } -- 2.11.0