OSDN Git Service

Merge with stable
[winmerge-jp/winmerge-jp.git] / Src / MergeEditView.cpp
index 2af8489..975235f 100644 (file)
@@ -2517,7 +2517,7 @@ HMENU CMergeEditView::createScriptsSubmenu(HMENU hMenu)
        if (functionNamesList.size() == 0)
        {
                // no script : create a <empty> entry
-               DoAppendMenu(hMenu, MF_STRING, ID_NO_EDIT_SCRIPTS, theApp.LoadString(IDS_NO_EDIT_SCRIPTS).c_str());
+               DoAppendMenu(hMenu, MF_STRING, ID_NO_EDIT_SCRIPTS, _("< Empty >").c_str());
        }
        else
        {
@@ -2530,7 +2530,7 @@ HMENU CMergeEditView::createScriptsSubmenu(HMENU hMenu)
        }
 
        if (!IsWindowsScriptThere())
-               DoAppendMenu(hMenu, MF_STRING, ID_NO_SCT_SCRIPTS, theApp.LoadString(ID_NO_SCT_SCRIPTS).c_str());
+               DoAppendMenu(hMenu, MF_STRING, ID_NO_SCT_SCRIPTS, _("WSH not found - .sct scripts disabled").c_str());
 
        return hMenu;
 }
@@ -2559,7 +2559,7 @@ HMENU CMergeEditView::createPrediffersSubmenu(HMENU hMenu)
        ASSERT(pd);
 
        // title
-       DoAppendMenu(hMenu, MF_STRING, ID_NO_PREDIFFER, theApp.LoadString(IDS_NO_PREDIFFER).c_str());
+       DoAppendMenu(hMenu, MF_STRING, ID_NO_PREDIFFER, _("No prediffer (normal)").c_str());
 
        // get the scriptlet files
        PluginArray * piScriptArray = 
@@ -2570,7 +2570,7 @@ HMENU CMergeEditView::createPrediffersSubmenu(HMENU hMenu)
        // build the menu : first part, suggested plugins
        // title
        DoAppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
-       DoAppendMenu(hMenu, MF_STRING, ID_SUGGESTED_PLUGINS, theApp.LoadString(IDS_SUGGESTED_PLUGINS).c_str());
+       DoAppendMenu(hMenu, MF_STRING, ID_SUGGESTED_PLUGINS, _("Suggested plugins").c_str());
 
        int ID = ID_PREDIFFERS_FIRST;   // first ID in menu
        int iScript;
@@ -2594,7 +2594,7 @@ HMENU CMergeEditView::createPrediffersSubmenu(HMENU hMenu)
        // build the menu : second part, others plugins
        // title
        DoAppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
-       DoAppendMenu(hMenu, MF_STRING, ID_NOT_SUGGESTED_PLUGINS, theApp.LoadString(IDS_NOT_SUGGESTED_PLUGINS).c_str());
+       DoAppendMenu(hMenu, MF_STRING, ID_NOT_SUGGESTED_PLUGINS, _("Other plugins").c_str());
 
        ID = ID_PREDIFFERS_FIRST;       // first ID in menu
        for (iScript = 0 ; iScript < piScriptArray->size() ; iScript++, ID ++)
@@ -2849,7 +2849,7 @@ void CMergeEditView::OnWMGoto()
        nLastLine = pDoc->m_ptBuf[m_nThisPane]->ComputeRealLine(nLineCount - 1);
 
        // Set active file and current line selected in dialog
-       dlg.m_strParam.Format(_T("%d"), nRealLine + 1);
+       dlg.m_strParam = string_to_str(nRealLine + 1);
        dlg.m_nFile = (pDoc->m_nBuffers < 3) ? (m_nThisPane == 1 ? 2 : 0) : m_nThisPane;
        dlg.m_nGotoWhat = 0;
 
@@ -2861,9 +2861,12 @@ void CMergeEditView::OnWMGoto()
                // Get views
                pCurrentView = GetGroupView(m_nThisPane);
 
+               int num = 0;
+               try { num = string_stoi(dlg.m_strParam) - 1; } catch(...) {}
+
                if (dlg.m_nGotoWhat == 0)
                {
-                       int nRealLine = _ttoi(dlg.m_strParam) - 1;
+                       int nRealLine = num;
                        if (nRealLine < 0)
                                nRealLine = 0;
                        if (nRealLine > nLastLine)
@@ -2873,7 +2876,7 @@ void CMergeEditView::OnWMGoto()
                }
                else
                {
-                       int diff = _ttoi(dlg.m_strParam) - 1;
+                       int diff = num;
                        if (diff < 0)
                                diff = 0;
                        if (diff >= pDoc->m_diffList.GetSize())
@@ -3237,7 +3240,6 @@ void CMergeEditView::OnEditCopyLineNumbers()
        CPoint ptEnd;
        CString strText;
        CString strLine;
-       CString strNum;
        CString strNumLine;
        UINT line = 0;
        int nNumWidth = 0;
@@ -3247,8 +3249,7 @@ void CMergeEditView::OnEditCopyLineNumbers()
 
        // Get last selected line (having widest linenumber)
        line = pDoc->m_ptBuf[m_nThisPane]->ComputeRealLine(ptEnd.y);
-       strNum.Format(_T("%d"), line + 1);
-       nNumWidth = strNum.GetLength();
+       nNumWidth = string_to_str(line + 1).length();
        
        for (int i = ptStart.y; i <= ptEnd.y; i++)
        {
@@ -3260,8 +3261,7 @@ void CMergeEditView::OnEditCopyLineNumbers()
 
                // Insert spaces to align different width linenumbers (99, 100)
                strLine = GetLineText(i);
-               strNum.Format(_T("%d"), line + 1);
-               CString sSpaces(' ', nNumWidth - strNum.GetLength());
+               CString sSpaces(' ', nNumWidth - string_to_str(line + 1).length());
                
                strText += sSpaces;
                strNumLine.Format(_T("%d: %s"), line + 1, strLine);