summaryrefslogtreecommitdiff
path: root/plugins/SpellChecker
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-25 10:31:04 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-25 10:31:04 +0000
commit8ae3679aa1339ce9abee53adb69902bd6b7513dc (patch)
tree94ef8927e12043ed6dcc15e1e640d68a8add520e /plugins/SpellChecker
parent1e273e28d89b5838e3d0f0cafac9676577cb71ce (diff)
hello, Unix.
phase 1: removing _T() git-svn-id: http://svn.miranda-ng.org/main/trunk@17127 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SpellChecker')
-rw-r--r--plugins/SpellChecker/src/RichEdit.cpp6
-rw-r--r--plugins/SpellChecker/src/autoreplace.cpp6
-rw-r--r--plugins/SpellChecker/src/dictionary.cpp38
-rw-r--r--plugins/SpellChecker/src/spellchecker.cpp16
-rw-r--r--plugins/SpellChecker/src/stdafx.h6
-rw-r--r--plugins/SpellChecker/src/utils.cpp4
6 files changed, 38 insertions, 38 deletions
diff --git a/plugins/SpellChecker/src/RichEdit.cpp b/plugins/SpellChecker/src/RichEdit.cpp
index a7827bfce0..ea5846a42a 100644
--- a/plugins/SpellChecker/src/RichEdit.cpp
+++ b/plugins/SpellChecker/src/RichEdit.cpp
@@ -201,14 +201,14 @@ TCHAR* RichEdit::GetText(int start, int end) const
if (m_textDocument != NULL) {
ITextRange *range;
if (m_textDocument->Range(start, end, &range) != S_OK)
- return mir_tstrdup(_T(""));
+ return mir_tstrdup(L"");
BSTR text = NULL;
if (FAILED(range->GetText(&text))) {
if (text)
::SysFreeString(text);
range->Release();
- return mir_tstrdup(_T(""));
+ return mir_tstrdup(L"");
}
TCHAR *res = mir_u2t(text);
@@ -281,7 +281,7 @@ int RichEdit::Delete(int start, int end)
CHARRANGE replace_sel = { start, end };
SetSel(replace_sel);
- ReplaceSel(_T(""));
+ ReplaceSel(L"");
int dif = FixSel(&sel, replace_sel, 0);
SetSel(sel);
diff --git a/plugins/SpellChecker/src/autoreplace.cpp b/plugins/SpellChecker/src/autoreplace.cpp
index e897d7e84c..899146ffdf 100644
--- a/plugins/SpellChecker/src/autoreplace.cpp
+++ b/plugins/SpellChecker/src/autoreplace.cpp
@@ -39,7 +39,7 @@ AutoReplaceMap::AutoReplaceMap(TCHAR *aFilename, Dictionary *dict)
void AutoReplaceMap::loadAutoReplaceMap()
{
- FILE *file = _tfopen(m_filename, _T("rb"));
+ FILE *file = _tfopen(m_filename, L"rb");
if (file == NULL)
return;
@@ -96,7 +96,7 @@ void AutoReplaceMap::writeAutoReplaceMap()
}
// Write it
- FILE *file = _tfopen(m_filename, _T("wb"));
+ FILE *file = _tfopen(m_filename, L"wb");
if (file != NULL) {
map<tstring, AutoReplacement>::iterator it = m_replacements.begin();
for (; it != m_replacements.end(); it++) {
@@ -120,7 +120,7 @@ BOOL AutoReplaceMap::isWordChar(TCHAR c)
if (IsNumber(c))
return TRUE;
- if (_tcschr(_T("-_.!@#$%&*()[]{}<>:?/\\=+"), c) != NULL)
+ if (_tcschr(L"-_.!@#$%&*()[]{}<>:?/\\=+", c) != NULL)
return TRUE;
return m_dict->isWordChar(c);
diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp
index 371b934d01..58218fc2b1 100644
--- a/plugins/SpellChecker/src/dictionary.cpp
+++ b/plugins/SpellChecker/src/dictionary.cpp
@@ -19,8 +19,8 @@ Boston, MA 02111-1307, USA.
#include "stdafx.h"
-#define APPPATH _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\%s")
-#define MUICACHE _T("Software\\Microsoft\\Windows\\ShellNoRoam\\MUICache")
+#define APPPATH L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\%s"
+#define MUICACHE L"Software\\Microsoft\\Windows\\ShellNoRoam\\MUICache"
// Additional languages that i could not find in Windows
@@ -28,16 +28,16 @@ struct {
TCHAR *language;
TCHAR *localized_name;
} aditionalLanguages[] = {
- { _T("tl_PH"), LPGENT("Tagalog (Philippines)") },
- { _T("de_frami_neu"), LPGENT("German (Germany)") }
+ { L"tl_PH", LPGENT("Tagalog (Philippines)") },
+ { L"de_frami_neu", LPGENT("German (Germany)") }
};
struct {
TCHAR *name;
TCHAR *key;
} otherHunspellApps[] = {
- { _T("Thunderbird"), _T("thunderbird.exe") },
- { _T("Firefox"), _T("firefox.exe") }
+ { L"Thunderbird", L"thunderbird.exe" },
+ { L"Firefox", L"firefox.exe" }
};
struct {
@@ -365,9 +365,9 @@ protected:
void loadCustomDict()
{
TCHAR filename[1024];
- mir_sntprintf(filename, _T("%s\\%s.cdic"), userPath, language);
+ mir_sntprintf(filename, L"%s\\%s.cdic", userPath, language);
- FILE *file = _tfopen(filename, _T("rb"));
+ FILE *file = _tfopen(filename, L"rb");
if (file != NULL) {
char tmp[1024];
int c, pos = 0;
@@ -393,9 +393,9 @@ protected:
CreateDirectoryTreeT(userPath);
TCHAR filename[1024];
- mir_sntprintf(filename, _T("%s\\%s.cdic"), userPath, language);
+ mir_sntprintf(filename, L"%s\\%s.cdic", userPath, language);
- FILE *file = _tfopen(filename, _T("ab"));
+ FILE *file = _tfopen(filename, L"ab");
if (file != NULL) {
char tmp[1024];
toHunspell(tmp, word, _countof(tmp));
@@ -734,7 +734,7 @@ BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString)
GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO3166CTRYNAME, end, _countof(end));
TCHAR name[64];
- mir_sntprintf(name, _T("%s_%s"), ini, end);
+ mir_sntprintf(name, L"%s_%s", ini, end);
for (int i = 0; i < tmp_dicts->getCount(); i++) {
Dictionary *dict = (*tmp_dicts)[i];
@@ -752,7 +752,7 @@ BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString)
TCHAR localName[1024];
if (country[0] != 0)
- mir_sntprintf(localName, _T("%s (%s)"), dict->english_name, country);
+ mir_sntprintf(localName, L"%s (%s)", dict->english_name, country);
else
mir_tstrncpy(localName, dict->english_name, _countof(localName));
@@ -760,7 +760,7 @@ BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString)
}
if (dict->localized_name[0] != 0) {
- mir_sntprintf(dict->full_name, _T("%s [%s]"), dict->localized_name, dict->language);
+ mir_sntprintf(dict->full_name, L"%s [%s]", dict->localized_name, dict->language);
}
break;
}
@@ -798,7 +798,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts)
}
if (dict->localized_name[0] != _T('\0')) {
- mir_sntprintf(dict->full_name, _T("%s [%s]"), dict->localized_name, dict->language);
+ mir_sntprintf(dict->full_name, L"%s [%s]", dict->localized_name, dict->language);
}
else {
mir_tstrncpy(dict->full_name, dict->language, _countof(dict->full_name));
@@ -812,7 +812,7 @@ void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, TCHAR *path, TCH
{
// Load the language files and create an array with then
TCHAR file[1024] = { 0 };
- mir_sntprintf(file, _T("%s\\*.dic"), path);
+ mir_sntprintf(file, L"%s\\*.dic", path);
BOOL found = FALSE;
@@ -820,7 +820,7 @@ void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, TCHAR *path, TCH
HANDLE hFFD = FindFirstFile(file, &ffd);
if (hFFD != INVALID_HANDLE_VALUE) {
do {
- mir_sntprintf(file, _T("%s\\%s"), path, ffd.cFileName);
+ mir_sntprintf(file, L"%s\\%s", path, ffd.cFileName);
// Check .dic
DWORD attrib = GetFileAttributes(file);
@@ -828,7 +828,7 @@ void GetHunspellDictionariesFromFolder(LIST<Dictionary> &dicts, TCHAR *path, TCH
continue;
// See if .aff exists too
- mir_tstrcpy(&file[mir_tstrlen(file) - 4], _T(".aff"));
+ mir_tstrcpy(&file[mir_tstrlen(file) - 4], L".aff");
attrib = GetFileAttributes(file);
if (attrib == 0xFFFFFFFF || (attrib & FILE_ATTRIBUTE_DIRECTORY))
continue;
@@ -876,7 +876,7 @@ void GetAvaibleDictionaries(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_pa
LONG lResult = 0;
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, KEY_QUERY_VALUE, &hKey)) {
DWORD size = _countof(key);
- lResult = RegQueryValueEx(hKey, _T("Path"), NULL, NULL, (LPBYTE)key, &size);
+ lResult = RegQueryValueEx(hKey, L"Path", NULL, NULL, (LPBYTE)key, &size);
RegCloseKey(hKey);
}
else {
@@ -908,7 +908,7 @@ void GetAvaibleDictionaries(LIST<Dictionary> &dicts, TCHAR *path, TCHAR *user_pa
if (ERROR_SUCCESS == lResult) {
TCHAR folder[1024];
- mir_sntprintf(folder, _T("%s\\Dictionaries"), key);
+ mir_sntprintf(folder, L"%s\\Dictionaries", key);
GetHunspellDictionariesFromFolder(languages, folder, user_path, otherHunspellApps[i].name);
}
diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp
index e35670841a..7d12a021f5 100644
--- a/plugins/SpellChecker/src/spellchecker.cpp
+++ b/plugins/SpellChecker/src/spellchecker.cpp
@@ -80,7 +80,7 @@ static int IconsChanged(WPARAM, LPARAM)
sid.dwId = i;
TCHAR tmp[128];
- mir_sntprintf(tmp, _T("%s - %s"), TranslateT("Spell Checker"), languages[i]->full_name);
+ mir_sntprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name);
sid.tszTooltip = tmp;
HICON hIcon = (opts.use_flags) ? IcoLib_GetIconByHandle(languages[i]->hIcolib) : IcoLib_GetIcon("spellchecker_enabled");
@@ -109,19 +109,19 @@ static int ModulesLoaded(WPARAM, LPARAM)
// Folders plugin support
if (hDictionariesFolder = FoldersRegisterCustomPathT(LPGEN("Spell Checker"), LPGEN("Dictionaries"), DICTIONARIES_FOLDER)) {
dictionariesFolder = (TCHAR *)mir_alloc(sizeof(TCHAR) * MAX_PATH);
- FoldersGetCustomPathT(hDictionariesFolder, dictionariesFolder, MAX_PATH, _T("."));
+ FoldersGetCustomPathT(hDictionariesFolder, dictionariesFolder, MAX_PATH, L".");
}
else dictionariesFolder = Utils_ReplaceVarsT(DICTIONARIES_FOLDER);
if (hCustomDictionariesFolder = FoldersRegisterCustomPathT(LPGEN("Spell Checker"), LPGEN("Custom Dictionaries"), CUSTOM_DICTIONARIES_FOLDER)) {
customDictionariesFolder = (TCHAR *)mir_alloc(sizeof(TCHAR) * MAX_PATH);
- FoldersGetCustomPathT(hCustomDictionariesFolder, customDictionariesFolder, MAX_PATH, _T("."));
+ FoldersGetCustomPathT(hCustomDictionariesFolder, customDictionariesFolder, MAX_PATH, L".");
}
else customDictionariesFolder = Utils_ReplaceVarsT(CUSTOM_DICTIONARIES_FOLDER);
if (hFlagsDllFolder = FoldersRegisterCustomPathT(LPGEN("Spell Checker"), LPGEN("Flags DLL"), FLAGS_DLL_FOLDER)) {
flagsDllFolder = (TCHAR *)mir_alloc(sizeof(TCHAR) * MAX_PATH);
- FoldersGetCustomPathT(hFlagsDllFolder, flagsDllFolder, MAX_PATH, _T("."));
+ FoldersGetCustomPathT(hFlagsDllFolder, flagsDllFolder, MAX_PATH, L".");
}
else flagsDllFolder = Utils_ReplaceVarsT(FLAGS_DLL_FOLDER);
@@ -134,7 +134,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
if (opts.use_flags) {
// Load flags dll
TCHAR flag_file[MAX_PATH];
- mir_sntprintf(flag_file, _T("%s\\flags_icons.dll"), flagsDllFolder);
+ mir_sntprintf(flag_file, L"%s\\flags_icons.dll", flagsDllFolder);
HMODULE hFlagsDll = LoadLibraryEx(flag_file, NULL, LOAD_LIBRARY_AS_DATAFILE);
TCHAR path[MAX_PATH];
@@ -142,7 +142,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
SKINICONDESC sid = { 0 };
sid.flags = SIDF_ALL_TCHAR | SIDF_SORTED;
- sid.section.t = LPGENT("Spell Checker") _T("/") LPGENT("Flags");
+ sid.section.t = LPGENT("Spell Checker") L"/" LPGENT("Flags");
// Get language flags
for (int i = 0; i < languages.getCount(); i++) {
@@ -184,7 +184,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
Dictionary *dict = languages[j];
TCHAR filename[MAX_PATH];
- mir_sntprintf(filename, _T("%s\\%s.ar"), customDictionariesFolder, dict->language);
+ mir_sntprintf(filename, L"%s\\%s.ar", customDictionariesFolder, dict->language);
dict->autoReplace = new AutoReplaceMap(filename, dict);
if (mir_tstrcmp(dict->language, opts.default_language) == 0)
@@ -205,7 +205,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
sid.dwId = i;
TCHAR tmp[128];
- mir_sntprintf(tmp, _T("%s - %s"), TranslateT("Spell Checker"), languages[i]->full_name);
+ mir_sntprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name);
sid.tszTooltip = tmp;
sid.hIcon = (opts.use_flags) ? IcoLib_GetIconByHandle(languages[i]->hIcolib) : IcoLib_GetIcon("spellchecker_enabled");
Srmm_AddIcon(&sid);
diff --git a/plugins/SpellChecker/src/stdafx.h b/plugins/SpellChecker/src/stdafx.h
index fa10f3dbfe..66e5e39f3f 100644
--- a/plugins/SpellChecker/src/stdafx.h
+++ b/plugins/SpellChecker/src/stdafx.h
@@ -70,9 +70,9 @@ using namespace std;
#define MODULE_NAME "SpellChecker"
-#define FLAGS_DLL_FOLDER _T("%miranda_path%\\Icons")
-#define CUSTOM_DICTIONARIES_FOLDER _T("%miranda_userdata%\\Dictionaries")
-#define DICTIONARIES_FOLDER _T("%miranda_path%\\Dictionaries")
+#define FLAGS_DLL_FOLDER L"%miranda_path%\\Icons"
+#define CUSTOM_DICTIONARIES_FOLDER L"%miranda_userdata%\\Dictionaries"
+#define DICTIONARIES_FOLDER L"%miranda_path%\\Dictionaries"
// Global Variables
extern HINSTANCE hInst;
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp
index 15fe69f0e7..7242f0c98c 100644
--- a/plugins/SpellChecker/src/utils.cpp
+++ b/plugins/SpellChecker/src/utils.cpp
@@ -440,7 +440,7 @@ void ToLocaleID(TCHAR *szKLName, size_t size)
GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO639LANGNAME, ini, _countof(ini));
GetLocaleInfo(MAKELCID(langID, 0), LOCALE_SISO3166CTRYNAME, end, _countof(end));
- mir_sntprintf(szKLName, size, _T("%s_%s"), ini, end);
+ mir_sntprintf(szKLName, size, L"%s_%s", ini, end);
}
void LoadDictFromKbdl(Dialog *dlg)
@@ -449,7 +449,7 @@ void LoadDictFromKbdl(Dialog *dlg)
// Use default input language
HKL hkl = GetKeyboardLayout(0);
- mir_sntprintf(szKLName, _T("%x"), (int)LOWORD(hkl));
+ mir_sntprintf(szKLName, L"%x", (int)LOWORD(hkl));
ToLocaleID(szKLName, _countof(szKLName));
int d = GetClosestLanguage(szKLName);