From 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jul 2016 09:20:25 +0000 Subject: less TCHARs: - TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SpellChecker/src/RichEdit.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'plugins/SpellChecker/src/RichEdit.cpp') diff --git a/plugins/SpellChecker/src/RichEdit.cpp b/plugins/SpellChecker/src/RichEdit.cpp index ea5846a42a..1317f767cd 100644 --- a/plugins/SpellChecker/src/RichEdit.cpp +++ b/plugins/SpellChecker/src/RichEdit.cpp @@ -143,7 +143,7 @@ int RichEdit::GetLineCount() const return SendMessage(EM_GETLINECOUNT, 0, 0); } -void RichEdit::GetLine(int line, TCHAR *text, size_t text_len) const +void RichEdit::GetLine(int line, wchar_t *text, size_t text_len) const { *((WORD*)text) = WORD(text_len - 1); unsigned size = (unsigned)SendMessage(EM_GETLINE, (WPARAM)line, (LPARAM)text); @@ -152,7 +152,7 @@ void RichEdit::GetLine(int line, TCHAR *text, size_t text_len) const // to make both implementations return same size int lineLen = GetLineLength(line); size = (unsigned)max(0, min((int)text_len - 1, min((int)size, lineLen))); - text[size] = _T('\0'); + text[size] = '\0'; } int RichEdit::GetLineLength(int line) const @@ -193,7 +193,7 @@ int RichEdit::GetTextLength() const return GetWindowTextLength(m_hwnd); } -TCHAR* RichEdit::GetText(int start, int end) const +wchar_t* RichEdit::GetText(int start, int end) const { if (end <= start) end = GetTextLength(); @@ -211,26 +211,26 @@ TCHAR* RichEdit::GetText(int start, int end) const return mir_tstrdup(L""); } - TCHAR *res = mir_u2t(text); + wchar_t *res = mir_u2t(text); range->Release(); ::SysFreeString(text); return res; } int len = (GetTextLength() + 1); - TCHAR *tmp = (TCHAR *)mir_alloc(len * sizeof(TCHAR)); + wchar_t *tmp = (wchar_t *)mir_alloc(len * sizeof(wchar_t)); GetWindowText(m_hwnd, tmp, len); tmp[len] = 0; - TCHAR *ret = (TCHAR *)mir_alloc((end - start + 1) * sizeof(TCHAR)); - memmove(ret, &tmp[start], (end - start) * sizeof(TCHAR)); + wchar_t *ret = (wchar_t *)mir_alloc((end - start + 1) * sizeof(wchar_t)); + memmove(ret, &tmp[start], (end - start) * sizeof(wchar_t)); ret[end - start] = 0; mir_free(tmp); return ret; } -void RichEdit::ReplaceSel(const TCHAR *new_text) +void RichEdit::ReplaceSel(const wchar_t *new_text) { if (m_stopped) { CHARRANGE sel = GetSel(); @@ -249,7 +249,7 @@ void RichEdit::ReplaceSel(const TCHAR *new_text) else SendMessage(EM_REPLACESEL, m_undoEnabled, (LPARAM)new_text); } -int RichEdit::Replace(int start, int end, const TCHAR *new_text) +int RichEdit::Replace(int start, int end, const wchar_t *new_text) { CHARRANGE sel = GetSel(); CHARRANGE replace_sel = { start, end }; @@ -262,7 +262,7 @@ int RichEdit::Replace(int start, int end, const TCHAR *new_text) return dif; } -int RichEdit::Insert(int pos, const TCHAR *text) +int RichEdit::Insert(int pos, const wchar_t *text) { CHARRANGE sel = GetSel(); CHARRANGE replace_sel = { pos, pos }; -- cgit v1.2.3