diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
commit | 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch) | |
tree | 2e8bb660c908b54914abd562af8aafa4a486c846 /plugins/PasteIt/src | |
parent | a61c8728b379057fe7f0a0d86fe0b037598229dd (diff) |
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
Diffstat (limited to 'plugins/PasteIt/src')
-rw-r--r-- | plugins/PasteIt/src/Options.cpp | 70 | ||||
-rw-r--r-- | plugins/PasteIt/src/PasteIt.cpp | 16 | ||||
-rw-r--r-- | plugins/PasteIt/src/PasteToWeb.h | 6 | ||||
-rw-r--r-- | plugins/PasteIt/src/PasteToWeb1.h | 2 | ||||
-rw-r--r-- | plugins/PasteIt/src/PasteToWeb2.h | 2 |
5 files changed, 48 insertions, 48 deletions
diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp index 61d4c27130..628fdd9182 100644 --- a/plugins/PasteIt/src/Options.cpp +++ b/plugins/PasteIt/src/Options.cpp @@ -23,30 +23,30 @@ Options *Options::instance; struct TCpTable
{
UINT cpId;
- TCHAR *cpName;
+ wchar_t *cpName;
}
cpTable[] = {
- { CP_ACP, LPGENT("Use default codepage") },
- { CP_UTF8, LPGENT("UTF-8") },
- { 874, LPGENT("Thai") },
- { 932, LPGENT("Japanese") },
- { 936, LPGENT("Simplified Chinese") },
- { 949, LPGENT("Korean") },
- { 950, LPGENT("Traditional Chinese") },
- { 1250, LPGENT("Central European") },
- { 1251, LPGENT("Cyrillic") },
- { 20866, LPGENT("Cyrillic KOI8-R") },
- { 1252, LPGENT("Latin I") },
- { 1253, LPGENT("Greek") },
- { 1254, LPGENT("Turkish") },
- { 1255, LPGENT("Hebrew") },
- { 1256, LPGENT("Arabic") },
- { 1257, LPGENT("Baltic") },
- { 1258, LPGENT("Vietnamese") },
- { 1361, LPGENT("Korean (Johab)") },
- { CP_UTF7, LPGENT("UTF-7") },
- { 1200, LPGENT("UTF-16") },
- { 1201, LPGENT("UTF-16BE") }
+ { CP_ACP, LPGENW("Use default codepage") },
+ { CP_UTF8, LPGENW("UTF-8") },
+ { 874, LPGENW("Thai") },
+ { 932, LPGENW("Japanese") },
+ { 936, LPGENW("Simplified Chinese") },
+ { 949, LPGENW("Korean") },
+ { 950, LPGENW("Traditional Chinese") },
+ { 1250, LPGENW("Central European") },
+ { 1251, LPGENW("Cyrillic") },
+ { 20866, LPGENW("Cyrillic KOI8-R") },
+ { 1252, LPGENW("Latin I") },
+ { 1253, LPGENW("Greek") },
+ { 1254, LPGENW("Turkish") },
+ { 1255, LPGENW("Hebrew") },
+ { 1256, LPGENW("Arabic") },
+ { 1257, LPGENW("Baltic") },
+ { 1258, LPGENW("Vietnamese") },
+ { 1361, LPGENW("Korean (Johab)") },
+ { CP_UTF7, LPGENW("UTF-7") },
+ { 1200, LPGENW("UTF-16") },
+ { 1201, LPGENW("UTF-16BE") }
};
Options::Options()
@@ -209,7 +209,7 @@ void GetPagesSettings(HWND hwndDlg, OptsPagesData* optsPagesData) optsPagesData->webOptions[selected]->pastebinUserKey = L"";
}
else {
- TCHAR buf[100];
+ wchar_t buf[100];
Edit_GetText(GetDlgItem(hwndDlg, IDC_PASTEBIN_KEY), buf, 100);
optsPagesData->webOptions[selected]->pastebinUserKey = buf;
}
@@ -584,7 +584,7 @@ INT_PTR CALLBACK Options::DlgProcOptsLogin(HWND hwndDlg, UINT msg, WPARAM wParam {
if (HIWORD(wParam) == BN_CLICKED) {
if (LOWORD(wParam) == IDOK) {
- TCHAR buf[100];
+ wchar_t buf[100];
OptsLoginData* optsLoginData = (OptsLoginData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
Edit_GetText(GetDlgItem(hwndDlg, IDC_PASTEBIN_USER), buf, 100);
optsLoginData->user = buf;
@@ -611,10 +611,10 @@ unsigned int Options::GetCodepageCB(HWND hwndCB, bool errorReport, unsigned int {
int selCpIdx = ComboBox_GetCurSel(hwndCB);
if (selCpIdx < 0) {
- TCHAR text[128];
+ wchar_t text[128];
ComboBox_GetText(hwndCB, text, 128);
- TCHAR * stopOn = NULL;
- long cp = _tcstol(text, &stopOn, 10);
+ wchar_t * stopOn = NULL;
+ long cp = wcstol(text, &stopOn, 10);
if (errorReport && (stopOn == text || *stopOn != '\0' || cp < 0 || cp > 0xffff)) {
MessageBox(GetParent(hwndCB), TranslateT("You've entered invalid codepage. Select codepage from combo box or enter correct number."), TranslateT("Invalid codepage"), MB_OK | MB_ICONERROR);
SetFocus(hwndCB);
@@ -645,7 +645,7 @@ void Options::InitCodepageCB(HWND hwndCB, unsigned int codepage) }
if (selCpIdx == -1) {
- TCHAR buf[10];
+ wchar_t buf[10];
mir_sntprintf(buf, L"%d", codepage);
ComboBox_SetText(hwndCB, buf);
}
@@ -666,7 +666,7 @@ void Options::SetCodepageCB(HWND hwndCB, unsigned int codepage) }
if (selCpIdx == -1) {
- TCHAR buf[10];
+ wchar_t buf[10];
mir_sntprintf(buf, L"%d", codepage);
ComboBox_SetText(hwndCB, buf);
}
@@ -681,15 +681,15 @@ int Options::InitOptions(WPARAM wParam, LPARAM) odp.position = 100000000;
odp.hInstance = hInst;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
- odp.ptszTitle = LPGENT("Paste It");
- odp.ptszGroup = LPGENT("Services");
+ odp.pwszTitle = LPGENW("Paste It");
+ odp.pwszGroup = LPGENW("Services");
- odp.ptszTab = LPGENT("Main");
+ odp.pwszTab = LPGENW("Main");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MAIN);
odp.pfnDlgProc = Options::DlgProcOptsMain;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Web page");
+ odp.pwszTab = LPGENW("Web page");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_PAGES);
odp.pfnDlgProc = Options::DlgProcOptsPages;
Options_AddPage(wParam, &odp);
@@ -705,7 +705,7 @@ void Options::Save() db_set_b(0, MODULE, "autoSend", autoSend ? 1 : 0);
for (int i = 0; i < PasteToWeb::pages; ++i) {
char buf[256];
- TCHAR* name = pasteToWebs[i]->GetName();
+ wchar_t* name = pasteToWebs[i]->GetName();
int j = 0;
while (name[j]) {
buf[j] = (char)name[j];
@@ -766,7 +766,7 @@ void Options::Load() char buf[256];
int j = 0;
{
- TCHAR *name = pasteToWebs[i]->GetName();
+ wchar_t *name = pasteToWebs[i]->GetName();
while (name[j]) {
buf[j] = (char)name[j];
++j;
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index d852b79f42..6c96d4d1ba 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -70,10 +70,10 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda std::wstring GetFile()
{
- TCHAR filter[512];
+ wchar_t filter[512];
mir_tstrncpy(filter, TranslateT("All Files (*.*)"), _countof(filter));
- memcpy(filter + mir_tstrlen(filter), L"\0*.*\0", 6 * sizeof(TCHAR));
- TCHAR stzFilePath[1024];
+ memcpy(filter + mir_tstrlen(filter), L"\0*.*\0", 6 * sizeof(wchar_t));
+ wchar_t stzFilePath[1024];
stzFilePath[0] = 0;
stzFilePath[1] = 0;
OPENFILENAME ofn = { 0 };
@@ -297,7 +297,7 @@ void InitMenuItems() mi.flags = CMIF_TCHAR;
mi.hIcolibItem = icon.hIcolib;
mi.position = 3000090005;
- mi.name.t = LPGENT("Paste It");
+ mi.name.w = LPGENW("Paste It");
hContactMenu = Menu_AddContactMenuItem(&mi);
memset(&mi, 0, sizeof(mi));
@@ -305,15 +305,15 @@ void InitMenuItems() mi.flags = CMIF_TCHAR;
mi.pszService = MS_PASTEIT_CONTACTMENU;
mi.root = hContactMenu;
- mi.name.t = LPGENT("Paste from clipboard");
+ mi.name.w = LPGENW("Paste from clipboard");
Menu_ConfigureItem(Menu_AddContactMenuItem(&mi), MCI_OPT_EXECPARAM, FROM_CLIPBOARD);
SET_UID(mi, 0x7af7c3cb, 0xedc4, 0x4f3e, 0xb5, 0xe1, 0x42, 0x64, 0x5b, 0x7d, 0xd8, 0x1e);
- mi.name.t = LPGENT("Paste from file");
+ mi.name.w = LPGENW("Paste from file");
Menu_ConfigureItem(Menu_AddContactMenuItem(&mi), MCI_OPT_EXECPARAM, FROM_FILE);
SET_UID(mi, 0xe58410ad, 0xa723, 0x48b9, 0xab, 0x7e, 0x5e, 0x42, 0x8b, 0x8, 0x32, 0x2f);
- mi.name.t = LPGENT("Default web page");
+ mi.name.w = LPGENW("Default web page");
HGENMENU hDefWebMenu = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(hDefWebMenu, MCI_OPT_EXECPARAM, DEF_PAGES_START - 1);
@@ -325,7 +325,7 @@ void InitMenuItems() mi2.flags = CMIF_TCHAR | CMIF_UNMOVABLE;
if (Options::instance->defWeb == i)
mi2.flags |= CMIF_CHECKED;
- mi2.name.t = pasteToWebs[i]->GetName();
+ mi2.name.w = pasteToWebs[i]->GetName();
hWebPageMenus[i] = Menu_AddContactMenuItem(&mi2);
Menu_ConfigureItem(hWebPageMenus[i], MCI_OPT_EXECPARAM, mi2.position = DEF_PAGES_START + i);
}
diff --git a/plugins/PasteIt/src/PasteToWeb.h b/plugins/PasteIt/src/PasteToWeb.h index 51e2141790..fdedc388ac 100644 --- a/plugins/PasteIt/src/PasteToWeb.h +++ b/plugins/PasteIt/src/PasteToWeb.h @@ -30,14 +30,14 @@ protected: virtual void SendToServer(std::wstring str, std::wstring fileName, std::wstring format) = 0;
wchar_t* SendToWeb(char* url, std::map<std::string, std::string>& headers, std::wstring content);
PasteToWeb();
- TCHAR bufErr[1024];
+ wchar_t bufErr[1024];
public:
virtual ~PasteToWeb();
char szFileLink[256];
- TCHAR* error;
+ wchar_t* error;
void FromClipboard();
void FromFile(std::wstring file);
- virtual TCHAR* GetName() = 0;
+ virtual wchar_t* GetName() = 0;
virtual void ConfigureSettings() = 0;
int pageIndex;
virtual std::list<PasteFormat> GetFormats() = 0;
diff --git a/plugins/PasteIt/src/PasteToWeb1.h b/plugins/PasteIt/src/PasteToWeb1.h index 79c9f7dc06..50f835af4f 100644 --- a/plugins/PasteIt/src/PasteToWeb1.h +++ b/plugins/PasteIt/src/PasteToWeb1.h @@ -28,7 +28,7 @@ protected: public:
PasteToWeb1();
virtual ~PasteToWeb1();
- virtual TCHAR* GetName()
+ virtual wchar_t* GetName()
{
return L"pastebin.com";
}
diff --git a/plugins/PasteIt/src/PasteToWeb2.h b/plugins/PasteIt/src/PasteToWeb2.h index 6bbee7b455..891c92223f 100644 --- a/plugins/PasteIt/src/PasteToWeb2.h +++ b/plugins/PasteIt/src/PasteToWeb2.h @@ -27,7 +27,7 @@ protected: public:
PasteToWeb2();
virtual ~PasteToWeb2();
- virtual TCHAR* GetName()
+ virtual wchar_t* GetName()
{
return L"wklej.to";
}
|