OSDN Git Service

Change the type of the variable CMergeApp::m_strSaveAsPath from CString to String
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sat, 21 May 2016 12:36:26 +0000 (21:36 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sat, 21 May 2016 12:36:26 +0000 (21:36 +0900)
Src/ImgMergeFrm.cpp
Src/MainFrm.cpp
Src/Merge.cpp
Src/Merge.h
Src/MergeApp.h
Src/MergeDoc.cpp

index 9dedf05..36e8223 100644 (file)
@@ -1007,7 +1007,7 @@ bool CImgMergeFrame::PromptAndSaveIfNeeded(bool bAllowCancel)
                dlg.m_bDisableCancel = true;
        if (!m_filePaths.GetLeft().empty())
        {
-               if (theApp.m_strSaveAsPath.IsEmpty())
+               if (theApp.m_strSaveAsPath.empty())
                        dlg.m_sLeftFile = m_filePaths.GetLeft();
                else
                        dlg.m_sLeftFile = theApp.m_strSaveAsPath;
@@ -1018,7 +1018,7 @@ bool CImgMergeFrame::PromptAndSaveIfNeeded(bool bAllowCancel)
        {
                if (!m_filePaths.GetMiddle().empty())
                {
-                       if (theApp.m_strSaveAsPath.IsEmpty())
+                       if (theApp.m_strSaveAsPath.empty())
                                dlg.m_sMiddleFile = m_filePaths.GetMiddle();
                        else
                                dlg.m_sMiddleFile = theApp.m_strSaveAsPath;
@@ -1028,7 +1028,7 @@ bool CImgMergeFrame::PromptAndSaveIfNeeded(bool bAllowCancel)
        }
        if (!m_filePaths.GetRight().empty())
        {
-               if (theApp.m_strSaveAsPath.IsEmpty())
+               if (theApp.m_strSaveAsPath.empty())
                        dlg.m_sRightFile = m_filePaths.GetRight();
                else
                        dlg.m_sRightFile = theApp.m_strSaveAsPath;
index d7b8afb..f18f76d 100644 (file)
@@ -2442,7 +2442,7 @@ BOOL CMainFrame::DoOpenConflict(const String& conflictFile, bool checked)
        {
                // Open two parsed files to WinMerge, telling WinMerge to
                // save over original file (given as third filename).
-               theApp.m_strSaveAsPath = conflictFile.c_str();
+               theApp.m_strSaveAsPath = conflictFile;
                String theirs = _("Theirs File");
                String my = _("Mine File");
                theApp.m_strDescriptions[0] = theirs;
index b215888..cbcf648 100644 (file)
@@ -660,7 +660,7 @@ BOOL CMergeApp::ParseArgsAndDoOpen(MergeCmdLineInfo& cmdInfo, CMainFrame* pMainF
                m_bExitIfNoDiff = cmdInfo.m_bExitIfNoDiff;
                m_bEscShutdown = cmdInfo.m_bEscShutdown;
 
-               m_strSaveAsPath = cmdInfo.m_sOutputpath.c_str();
+               m_strSaveAsPath = cmdInfo.m_sOutputpath;
 
                m_strDescriptions[0] = cmdInfo.m_sLeftDesc;
                if (cmdInfo.m_Files.GetSize() < 3)
index c45b1db..73a303a 100644 (file)
@@ -68,7 +68,7 @@ public:
        std::unique_ptr<FileFilterHelper> m_pGlobalFileFilter;
        std::unique_ptr<SyntaxColors> m_pSyntaxColors; /**< Syntax color container */
        std::unique_ptr<SourceControl> m_pSourceControl;
-       CString m_strSaveAsPath; /**< "3rd path" where output saved if given */
+       String m_strSaveAsPath; /**< "3rd path" where output saved if given */
        BOOL m_bEscShutdown; /**< If commandline switch -e given ESC closes appliction */
        SyntaxColors * GetMainSyntaxColors() { return m_pSyntaxColors.get(); }
        BOOL m_bClearCaseTool; /**< WinMerge is executed as an external Rational ClearCase compare/merge tool. */
index 06819a9..1706566 100644 (file)
@@ -42,7 +42,7 @@ namespace AppMsgBox
        int information(const String& msg, int type = OK);
 };
 
-/** @brief Load string from string resources; shortcut for CString::LoadString */
+/** @brief Load string from string resources; shortcut for String::LoadString */
 String LoadResString(unsigned id);
 
 String tr(const std::string &str);
\ No newline at end of file
index 9b11197..2874483 100644 (file)
@@ -1376,9 +1376,9 @@ bool CMergeDoc::DoSave(LPCTSTR szPath, bool &bSaveSuccess, int nBuffer)
        bSaveSuccess = false;
        
        // Check third arg possibly given from command-line
-       if (!theApp.m_strSaveAsPath.IsEmpty())
+       if (!theApp.m_strSaveAsPath.empty())
        {
-               if (paths_DoesPathExist((const TCHAR *)theApp.m_strSaveAsPath) == IS_EXISTING_DIR)
+               if (paths_DoesPathExist(theApp.m_strSaveAsPath) == IS_EXISTING_DIR)
                {
                        // third arg was a directory, so get append the filename
                        String sname;
@@ -2213,7 +2213,7 @@ bool CMergeDoc::PromptAndSaveIfNeeded(bool bAllowCancel)
                dlg.m_bDisableCancel = true;
        if (!m_filePaths.GetLeft().empty())
        {
-               if (theApp.m_strSaveAsPath.IsEmpty())
+               if (theApp.m_strSaveAsPath.empty())
                        dlg.m_sLeftFile = m_filePaths.GetLeft();
                else
                        dlg.m_sLeftFile = theApp.m_strSaveAsPath;
@@ -2224,7 +2224,7 @@ bool CMergeDoc::PromptAndSaveIfNeeded(bool bAllowCancel)
        {
                if (!m_filePaths.GetMiddle().empty())
                {
-                       if (theApp.m_strSaveAsPath.IsEmpty())
+                       if (theApp.m_strSaveAsPath.empty())
                                dlg.m_sMiddleFile = m_filePaths.GetMiddle();
                        else
                                dlg.m_sMiddleFile = theApp.m_strSaveAsPath;
@@ -2234,7 +2234,7 @@ bool CMergeDoc::PromptAndSaveIfNeeded(bool bAllowCancel)
        }
        if (!m_filePaths.GetRight().empty())
        {
-               if (theApp.m_strSaveAsPath.IsEmpty())
+               if (theApp.m_strSaveAsPath.empty())
                        dlg.m_sRightFile = m_filePaths.GetRight();
                else
                        dlg.m_sRightFile = theApp.m_strSaveAsPath;