OSDN Git Service

PushDlg: Fix: Wrong remote selected after selection via ref-browser.
[tortoisegit/TortoiseGitJp.git] / src / Utils / MiscUI / HistoryCombo.cpp
index 1ea9e51..9040a5f 100644 (file)
@@ -152,6 +152,8 @@ int CHistoryCombo::AddString(CString str, INT_PTR pos)
        {\r
                DeleteItem(nIndex);\r
                m_arEntries.RemoveAt(nIndex);\r
+               //nRet is now (potentially) invalid. Reset it.\r
+               nRet = FindStringExact(0, str);\r
        }\r
 \r
        //truncate list to m_nMaxHistoryItems\r
@@ -329,12 +331,15 @@ CString CHistoryCombo::GetString() const
        CString str;\r
        int sel;\r
        sel = GetCurSel();\r
+       DWORD style=GetStyle();\r
+       \r
        if (sel == CB_ERR)\r
        {\r
                GetWindowText(str);\r
                return str;\r
        }\r
-       if ((m_bURLHistory)||(m_bPathHistory))\r
+\r
+       if ((m_bURLHistory)||(m_bPathHistory) || (!(style&CBS_SIMPLE)) )\r
        {\r
                //URL and path history combo boxes are editable, so get\r
                //the string directly from the combobox\r