OSDN Git Service

theApp is unnecessary because these methods are a static methods
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sat, 15 May 2021 06:15:53 +0000 (15:15 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sat, 15 May 2021 06:15:53 +0000 (15:15 +0900)
Src/DirView.cpp
Src/FileActionScript.cpp
Src/FileFiltersDlg.cpp
Src/HexMergeView.cpp
Src/ImgMergeFrm.cpp
Src/MainFrm.cpp
Src/Merge.cpp
Src/MergeDoc.cpp
Src/MergeEditView.cpp
Src/PatchTool.cpp

index a9c7ce2..a4e5312 100644 (file)
@@ -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)
index 20afc2a..7cbc616 100644 (file)
@@ -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);
index 6d922d0..469a974 100644 (file)
@@ -235,7 +235,7 @@ void FileFiltersDlg::OnFiltersEditbtn()
  */
 void FileFiltersDlg::EditFileFilter(const String& path)
 {
-       theApp.OpenFileToExternalEditor(path);
+       CMergeApp::OpenFileToExternalEditor(path);
 }
 
 /**
index 78f36c4..f5a3114 100644 (file)
@@ -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();
index 5749f59..0d1c7ce 100644 (file)
@@ -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());
index 09f0bca..8c4550a 100644 (file)
@@ -1639,7 +1639,7 @@ void CMainFrame::OnSaveConfigData()
        if (configLog.WriteLogFile(sError))
        {
                String sFileName = configLog.GetFileName();
-               theApp.OpenFileToExternalEditor(sFileName);
+               CMergeApp::OpenFileToExternalEditor(sFileName);
        }
        else
        {
index 36c8aa6..88eed47 100644 (file)
@@ -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&)
index 75412ec..6e61af2 100644 (file)
@@ -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
index b6fc755..f5e86e6 100644 (file)
@@ -3889,7 +3889,7 @@ void CMergeEditView::OnOpenFileWithEditor()
                return;
 
        int nRealLine = ComputeRealLine(GetCursorPos().y) + 1;
-       theApp.OpenFileToExternalEditor(sFileName, nRealLine);
+       CMergeApp::OpenFileToExternalEditor(sFileName, nRealLine);
 }
 
 /**
index ddfa1a7..d029b7a 100644 (file)
@@ -193,7 +193,7 @@ int CPatchTool::CreatePatch()
        if (retVal)
        {
                if (m_bOpenToEditor)
-                       theApp.OpenFileToExternalEditor(m_sPatchFile);
+                       CMergeApp::OpenFileToExternalEditor(m_sPatchFile);
        }
        return retVal;
 }