修订版 | 05c8f9df6a2bf92d17ece07d3ff73477df044bd0 (tree) |
---|---|
时间 | 2018-02-19 00:35:10 |
作者 | Takashi Sawanaka <sdottaka@user...> |
Commiter | Takashi Sawanaka |
Fix to show text that contains & on message box, correctly. sf.net#2067
@@ -210,8 +210,9 @@ DoHighlightText ( bool bNotifyIfNotFound ) | ||
210 | 210 | { |
211 | 211 | if ( bNotifyIfNotFound ) |
212 | 212 | { |
213 | - CString prompt; | |
214 | - prompt.Format (LoadResString(IDS_EDIT_TEXT_NOT_FOUND).c_str(), (LPCTSTR)m_sText); | |
213 | + CString prompt, text(m_sText); | |
214 | + text.Replace(_T("&"), _T("&&")); | |
215 | + prompt.Format (LoadResString(IDS_EDIT_TEXT_NOT_FOUND).c_str(), (LPCTSTR)text); | |
215 | 216 | AfxMessageBox (prompt, MB_ICONINFORMATION); |
216 | 217 | } |
217 | 218 | if (m_nScope == 0) |
@@ -250,8 +251,9 @@ DoReplaceText (LPCTSTR /*pszNewText*/, DWORD dwSearchFlags) | ||
250 | 251 | |
251 | 252 | if (!bFound) |
252 | 253 | { |
253 | - CString prompt; | |
254 | - prompt.Format (LoadResString(IDS_EDIT_TEXT_NOT_FOUND).c_str(), (LPCTSTR)m_sText); | |
254 | + CString prompt, text(m_sText); | |
255 | + text.Replace(_T("&"), _T("&&")); | |
256 | + prompt.Format (LoadResString(IDS_EDIT_TEXT_NOT_FOUND).c_str(), (LPCTSTR)text); | |
255 | 257 | AfxMessageBox (prompt, MB_ICONINFORMATION); |
256 | 258 | if (m_nScope == 0) |
257 | 259 | m_ptCurrentPos = m_ptBlockBegin; |
@@ -98,8 +98,9 @@ FindText (int nDirection) | ||
98 | 98 | |
99 | 99 | if (!m_pBuddy->FindText(GetLastSearchInfos())) |
100 | 100 | { |
101 | - CString prompt; | |
102 | - prompt.Format (LoadResString(IDS_EDIT_TEXT_NOT_FOUND).c_str(), (LPCTSTR)m_sText); | |
101 | + CString prompt, text(m_sText); | |
102 | + text.Replace(_T("&"), _T("&&")); | |
103 | + prompt.Format (LoadResString(IDS_EDIT_TEXT_NOT_FOUND).c_str(), (LPCTSTR)text); | |
103 | 104 | AfxMessageBox (prompt, MB_ICONINFORMATION); |
104 | 105 | } |
105 | 106 | else |