From 867acc8fe919830f4735ccfe8b9d99dc49319c90 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Sat, 19 Jan 2013 13:59:37 +0000 Subject: - Another portion of _T replacement when it's not needed (from person) git-svn-id: http://svn.miranda-ng.org/main/trunk@3169 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SmileyAdd/src/dlgboxsubclass.cpp | 20 +++---- plugins/SmileyAdd/src/general.cpp | 18 +++---- plugins/SmileyAdd/src/main.cpp | 4 +- plugins/SmileyAdd/src/options.cpp | 18 +++---- plugins/SmileyAdd/src/services.cpp | 20 +++---- plugins/SmileyAdd/src/smileyroutines.cpp | 6 +-- plugins/SmileyAdd/src/smileys.cpp | 93 ++++++++++++++++---------------- 7 files changed, 89 insertions(+), 90 deletions(-) (limited to 'plugins/SmileyAdd/src') diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp index 1970577b48..31ccc22f6d 100644 --- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp +++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp @@ -158,27 +158,27 @@ public: //identifies the message dialog bool IsMessageSendDialog(HWND hwnd) { - TCHAR szClassName[32] = _T(""); + TCHAR szClassName[32] = L""; GetClassName(hwnd, szClassName, SIZEOF(szClassName)); - if (_tcscmp(szClassName, _T("#32770"))) return false; + if (_tcscmp(szClassName, L"#32770")) return false; if ((REdit = GetDlgItem(hwnd, MI_IDC_LOG)) != NULL) { GetClassName(REdit, szClassName, SIZEOF(szClassName)); - if (_tcscmp(szClassName, _T("RichEdit20A")) != 0 && - _tcscmp(szClassName, _T("RichEdit20W")) != 0 && - _tcscmp(szClassName, _T("RICHEDIT50W")) != 0) return false; + if (_tcscmp(szClassName, L"RichEdit20A") != 0 && + _tcscmp(szClassName, L"RichEdit20W") != 0 && + _tcscmp(szClassName, L"RICHEDIT50W") != 0) return false; } else return false; if ((MEdit = GetDlgItem(hwnd, MI_IDC_MESSAGE)) != NULL) { GetClassName(MEdit, szClassName, SIZEOF(szClassName)); - if (_tcscmp(szClassName, _T("Edit")) != 0 && - _tcscmp(szClassName, _T("RichEdit20A")) != 0 && - _tcscmp(szClassName, _T("RichEdit20W")) != 0 && - _tcscmp(szClassName, _T("RICHEDIT50W")) != 0) return false; + if (_tcscmp(szClassName, L"Edit") != 0 && + _tcscmp(szClassName, L"RichEdit20A") != 0 && + _tcscmp(szClassName, L"RichEdit20W") != 0 && + _tcscmp(szClassName, L"RICHEDIT50W") != 0) return false; } else return false; @@ -236,7 +236,7 @@ public: hSmlButton = CreateWindowEx( WS_EX_LEFT | WS_EX_NOPARENTNOTIFY | WS_EX_TOPMOST, MIRANDABUTTONCLASS, - _T("S"), + L"S", WS_CHILD|WS_VISIBLE|WS_TABSTOP, // window style rect.left, // horizontal position of window rect.top, // vertical position of window diff --git a/plugins/SmileyAdd/src/general.cpp b/plugins/SmileyAdd/src/general.cpp index 8a232a3e23..6810934d11 100644 --- a/plugins/SmileyAdd/src/general.cpp +++ b/plugins/SmileyAdd/src/general.cpp @@ -46,7 +46,7 @@ int CalculateTextHeight(HDC hdc, CHARFORMAT2* chf) SelectObject(hcdc, hFont); SIZE fontSize; - GetTextExtentPoint32(hcdc, _T(")"), 1, &fontSize); + GetTextExtentPoint32(hcdc, L")", 1, &fontSize); DeleteObject(hFont); DeleteDC(hcdc); @@ -78,7 +78,7 @@ HICON GetDefaultIcon(bool copy) const TCHAR* GetImageExt(bkstring &fname) { - const TCHAR* ext = _T(""); + const TCHAR* ext = L""; int fileId = _topen(fname.c_str(), O_RDONLY | _O_BINARY); if (fileId != -1) @@ -89,13 +89,13 @@ const TCHAR* GetImageExt(bkstring &fname) if (bytes > 4) { if ( *(unsigned short*)buf == 0xd8ff ) - ext = _T("jpg"); + ext = L"jpg"; else if ( *(unsigned short*)buf == 0x4d42 ) - ext = _T("bmp"); + ext = L"bmp"; else if ( *(unsigned*)buf == 0x474e5089 ) - ext = _T("png"); + ext = L"png"; else if ( *(unsigned*)buf == 0x38464947 ) - ext = _T("gif"); + ext = L"gif"; } _close(fileId); } @@ -216,8 +216,8 @@ bool InitGdiPlus(void) { Gdiplus::GdiplusStartupInput gdiplusStartupInput; - static const TCHAR errmsg[] = _T("GDI+ not installed.\n") - _T("GDI+ can be downloaded here: http://www.microsoft.com/downloads"); + static const TCHAR errmsg[] = L"GDI+ not installed.\n" + L"GDI+ can be downloaded here: http://www.microsoft.com/downloads"; #ifdef _MSC_VER __try @@ -273,7 +273,7 @@ bool IsSmileyProto(char* proto) void ReportError(const TCHAR* errmsg) { - static const TCHAR title[] = _T("Miranda SmileyAdd"); + static const TCHAR title[] = L"Miranda SmileyAdd"; /* POPUPDATAW pd = {0}; diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp index 63f6929c6c..d6833684b4 100644 --- a/plugins/SmileyAdd/src/main.cpp +++ b/plugins/SmileyAdd/src/main.cpp @@ -100,8 +100,8 @@ extern "C" __declspec(dllexport) int Load(void) mir_getLP(&pluginInfoEx); if (ServiceExists(MS_SMILEYADD_REPLACESMILEYS)) { - static const TCHAR errmsg[] = _T("Only one instance of SmileyAdd could be executed.\n") - _T("Remove duplicate instances from 'Plugins' directory"); + static const TCHAR errmsg[] = L"Only one instance of SmileyAdd could be executed.\n" + L"Remove duplicate instances from 'Plugins' directory"; ReportError(TranslateTS(errmsg)); return 1; diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index b485c5ca99..2ca4e7ed29 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -529,7 +529,7 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item) { OPENFILENAME ofn = {0}; - TCHAR filename[MAX_PATH] = _T(""); + TCHAR filename[MAX_PATH] = L""; ofn.lpstrFile = filename; ofn.nMaxFile = SIZEOF(filename); @@ -537,7 +537,7 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item) SmileyCategoryType* smc = tmpsmcat.GetSmileyCategory(item); if (smc->GetFilename().empty()) { - pathToAbsolute(_T("Smileys"), inidir); + pathToAbsolute(L"Smileys", inidir); } else { @@ -551,21 +551,21 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item) TCHAR filter[512], *pfilter; _tcscpy(filter, TranslateT("Smiley Packs")); - lstrcat(filter, _T(" (*.msl;*.asl;*.xep)")); + lstrcat(filter, L" (*.msl;*.asl;*.xep)"); pfilter = filter + _tcslen(filter) + 1; - _tcscpy(pfilter, _T("*.msl;*.asl;*.xep")); + _tcscpy(pfilter, L"*.msl;*.asl;*.xep"); pfilter = pfilter + _tcslen(pfilter) + 1; _tcscpy(pfilter, TranslateT("All Files")); - lstrcat(pfilter, _T(" (*.*)")); + lstrcat(pfilter, L" (*.*)"); pfilter = pfilter + _tcslen(pfilter) + 1; - _tcscpy(pfilter, _T("*.*")); + _tcscpy(pfilter, L"*.*"); pfilter = pfilter + _tcslen(pfilter) + 1; *pfilter = '\0'; ofn.lpstrFilter = filter; ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_READONLY | OFN_EXPLORER | OFN_LONGNAMES | OFN_NOCHANGEDIR; - ofn.lpstrDefExt = _T("msl"); + ofn.lpstrDefExt = L"msl"; if (GetOpenFileName(&ofn)) { @@ -663,7 +663,7 @@ void OptionsType::ReadPackFileName(bkstring& filename, const bkstring& name, const bkstring& defaultFilename) { DBVARIANT dbv; - bkstring settingKey = name + _T("-filename"); + bkstring settingKey = name + L"-filename"; INT_PTR res = DBGetContactSettingTString(NULL, "SmileyAdd", T2A_SM(settingKey.c_str()), &dbv); if (res == 0) @@ -678,7 +678,7 @@ void OptionsType::ReadPackFileName(bkstring& filename, const bkstring& name, void OptionsType::WritePackFileName(const bkstring& filename, const bkstring& name) { - bkstring settingKey = name + _T("-filename"); + bkstring settingKey = name + L"-filename"; DBWriteContactSettingTString(NULL, "SmileyAdd", T2A_SM(settingKey.c_str()), filename.c_str()); } diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index 58e6c90c97..cfe069f731 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -43,7 +43,7 @@ SmileyPackType* GetSmileyPack(const char* proto, HANDLE hContact, SmileyPackCTyp if (hContact != NULL) { opt.ReadContactCategory(hContact, categoryName); - if (categoryName == _T("")) return NULL; + if (categoryName == L"") return NULL; if (!categoryName.empty() && g_SmileyCategories.GetSmileyCategory(categoryName) == NULL) { @@ -72,7 +72,7 @@ SmileyPackType* GetSmileyPack(const char* proto, HANDLE hContact, SmileyPackCTyp { if (proto == NULL || proto[0] == 0) { - categoryName = _T("Standard"); + categoryName = L"Standard"; } else { @@ -80,7 +80,7 @@ SmileyPackType* GetSmileyPack(const char* proto, HANDLE hContact, SmileyPackCTyp if (opt.UseOneForAll) { SmileyCategoryType *smc = g_SmileyCategories.GetSmileyCategory(categoryName); - if (smc == NULL || smc->IsProto()) categoryName = _T("Standard"); + if (smc == NULL || smc->IsProto()) categoryName = L"Standard"; } } } @@ -386,7 +386,7 @@ INT_PTR CustomCatMenu(WPARAM wParam, LPARAM lParam) else { bkstring empty; - if (lParam == 1) empty = _T(""); + if (lParam == 1) empty = L""; opt.WriteContactCategory(hContact, empty); } NotifyEventHooks(hEvent1, (WPARAM)hContact, 0); @@ -457,8 +457,8 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) mi.position = 1; mi.popupPosition = 1; - mi.ptszName = _T(""); - if (cat == _T("")) { + mi.ptszName = L""; + if (cat == L"") { mi.flags |= CMIF_CHECKED; nonecheck = false; } @@ -468,7 +468,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) mi.position = 2; mi.popupPosition = 2; - mi.ptszName = _T("Protocol specific"); + mi.ptszName = LPGENT("Protocol specific"); if (nonecheck) mi.flags |= CMIF_CHECKED; else mi.flags &= ~CMIF_CHECKED; hMenu = Menu_AddContactMenuItem(&mi); @@ -523,7 +523,7 @@ int AccountListChanged(WPARAM wParam, LPARAM lParam) case PRAC_ADDED: if (acc != NULL) { - bkstring catname(_T("Standard")); + bkstring catname(L"Standard"); const bkstring& defaultFile = g_SmileyCategories.GetSmileyCategory(catname)->GetFilename(); g_SmileyCategories.AddAccountAsCategory(acc, defaultFile); } @@ -551,7 +551,7 @@ int AccountListChanged(WPARAM wParam, LPARAM lParam) { if (acc->bIsEnabled) { - bkstring catname(_T("Standard")); + bkstring catname(L"Standard"); const bkstring& defaultFile = g_SmileyCategories.GetSmileyCategory(catname)->GetFilename(); g_SmileyCategories.AddAccountAsCategory(acc, defaultFile); } @@ -575,7 +575,7 @@ int DbSettingChanged(WPARAM wParam, LPARAM lParam) if (strcmp(cws->szSetting, "Transport") == 0) { - bkstring catname(_T("Standard")); + bkstring catname(L"Standard"); SmileyCategoryType *smc = g_SmileyCategories.GetSmileyCategory(catname); if (smc != NULL) g_SmileyCategories.AddContactTransportAsCategory(hContact, smc->GetFilename()); diff --git a/plugins/SmileyAdd/src/smileyroutines.cpp b/plugins/SmileyAdd/src/smileyroutines.cpp index 95a3d77002..98bd40b959 100644 --- a/plugins/SmileyAdd/src/smileyroutines.cpp +++ b/plugins/SmileyAdd/src/smileyroutines.cpp @@ -281,7 +281,7 @@ void ReplaceSmileys(HWND hwnd, SmileyPackType* smp, SmileyPackCType* smcp, const TCHAR classname[20]; GetClassName(hwnd, classname, SIZEOF(classname)); - bool ishpp = (_tcsncmp(classname, _T("THppRichEdit"), 12) == 0) || fireView; + bool ishpp = (_tcsncmp(classname, L"THppRichEdit", 12) == 0) || fireView; SetRichCallback(hwnd, NULL, false, true); @@ -526,8 +526,8 @@ void ReplaceSmileys(HWND hwnd, SmileyPackType* smp, SmileyPackCType* smcp, const QueryPerformanceCounter(&end); unsigned dif = (end.QuadPart - strt.QuadPart)/(freq.QuadPart/1000); TCHAR mess[300]; - wsprintf(mess, _T("Time elapsed: %u"), dif); - MessageBox(NULL, mess, _T(""), MB_OK); + wsprintf(mess, L"Time elapsed: %u", dif); + MessageBox(NULL, mess, L"", MB_OK); */ } diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index ef88e952e0..11077b93c6 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -163,7 +163,7 @@ static DWORD_PTR ConvertServiceParam(HANDLE hContact, const TCHAR *param) DWORD_PTR ret; if (param == NULL) ret = 0; - else if (_tcsicmp(_T("hContact"), param) == 0) + else if (_tcsicmp(L"hContact", param) == 0) ret = (DWORD_PTR)hContact; else if (_istdigit(*param)) ret = _ttoi(param); @@ -176,7 +176,7 @@ static DWORD_PTR ConvertServiceParam(HANDLE hContact, const TCHAR *param) void SmileyType::CallSmileyService(HANDLE hContact) { - _TPattern * srvsplit = _TPattern::compile(_T("(.*)\\|(.*)\\|(.*)")); + _TPattern * srvsplit = _TPattern::compile(L"(.*)\\|(.*)\\|(.*)"); _TMatcher * m0 = srvsplit->createTMatcher(GetTriggerText()); m0->findFirstMatch(); @@ -209,13 +209,13 @@ SmileyPackType::~SmileyPackType() } static const TCHAR urlRegEx[] = - _T("(?:ftp|https|http|file|aim|webcal|irc|msnim|xmpp|gopher|mailto|news|nntp|telnet|wais|prospero)://?[\\w.?%:/$+;]*"); -static const TCHAR pathRegEx[] = _T("[\\s\"][a-zA-Z]:[\\\\/][\\w.\\-\\\\/]*"); -static const TCHAR timeRegEx[] = _T("\\d{1,2}:\\d{2}:\\d{2}|\\d{1,2}:\\d{2}"); + L"(?:ftp|https|http|file|aim|webcal|irc|msnim|xmpp|gopher|mailto|news|nntp|telnet|wais|prospero)://?[\\w.?%:/$+;]*"; +static const TCHAR pathRegEx[] = L"[\\s\"][a-zA-Z]:[\\\\/][\\w.\\-\\\\/]*"; +static const TCHAR timeRegEx[] = L"\\d{1,2}:\\d{2}:\\d{2}|\\d{1,2}:\\d{2}"; void SmileyPackType::AddTriggersToSmileyLookup(void) { - _TPattern * p = _TPattern::compile(_T("\\s+")); + _TPattern * p = _TPattern::compile(L"\\s+"); { bkstring emptystr; @@ -286,8 +286,8 @@ void SmileyPackType::AddTriggersToSmileyLookup(void) void SmileyPackType::ReplaceAllSpecials(const bkstring& Input, bkstring& Output) { - Output = _TPattern::replace(_T("%%_{1,2}%%"), Input, _T(" ")); - Output = _TPattern::replace(_T("%%''%%"), Output, _T("\"")); + Output = _TPattern::replace(L"%%_{1,2}%%", Input, L" "); + Output = _TPattern::replace(L"%%''%%", Output, L"\""); } @@ -312,7 +312,7 @@ bool SmileyPackType::LoadSmileyFile(const bkstring& filename, bool onlyInfo, boo if (filename.empty()) { - m_Name = _T("Nothing loaded"); + m_Name = L"Nothing loaded"; return false; } @@ -325,14 +325,13 @@ bool SmileyPackType::LoadSmileyFile(const bkstring& filename, bool onlyInfo, boo { if (!noerr) { - static const TCHAR errmsg[] = _T("Smiley Pack %s not found.\n") - _T("Select correct Smiley Pack in the Miranda Options | Customize | Smileys."); + static const TCHAR errmsg[] = LPGENT("Smiley Pack %s not found.\nSelect correct Smiley Pack in the Miranda Options | Customize | Smileys."); TCHAR msgtxt[1024]; mir_sntprintf(msgtxt, SIZEOF(msgtxt), TranslateTS(errmsg), modpath.c_str()); ReportError(msgtxt); } - m_Name = _T("Nothing loaded"); + m_Name = L"Nothing loaded"; return false; } @@ -369,7 +368,7 @@ bool SmileyPackType::LoadSmileyFile(const bkstring& filename, bool onlyInfo, boo delete[] buf; bool res; - if (filename.find(_T(".xep")) == filename.npos) + if (filename.find(L".xep") == filename.npos) res = LoadSmileyFileMSL(tbuf, onlyInfo, modpath); else res = LoadSmileyFileXEP(tbuf, onlyInfo, modpath); @@ -381,7 +380,7 @@ bool SmileyPackType::LoadSmileyFile(const bkstring& filename, bool onlyInfo, boo bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& modpath) { - _TPattern * pathsplit = _TPattern::compile(_T("(.*\\\\)(.*)\\.|$")); + _TPattern * pathsplit = _TPattern::compile(L"(.*\\\\)(.*)\\.|$"); _TMatcher * m0 = pathsplit->createTMatcher(modpath); m0->findFirstMatch(); @@ -392,18 +391,18 @@ bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& delete pathsplit; _TPattern * otherf = _TPattern::compile( - _T("^\\s*(Name|Author|Date|Version|ButtonSmiley)\\s*=\\s*\"(.*)\""), + L"^\\s*(Name|Author|Date|Version|ButtonSmiley)\\s*=\\s*\"(.*)\"", _TPattern::MULTILINE_MATCHING); m0 = otherf->createTMatcher(tbuf); while (m0->findNextMatch()) { - if (m0->getGroup(1) == _T("Name")) m_Name = m0->getGroup(2); - if (m0->getGroup(1) == _T("Author")) m_Author = m0->getGroup(2); - if (m0->getGroup(1) == _T("Date")) m_Date = m0->getGroup(2); - if (m0->getGroup(1) == _T("Version")) m_Version = m0->getGroup(2); - if (m0->getGroup(1) == _T("ButtonSmiley")) m_ButtonSmiley = m0->getGroup(2); + if (m0->getGroup(1) == L"Name") m_Name = m0->getGroup(2); + if (m0->getGroup(1) == L"Author") m_Author = m0->getGroup(2); + if (m0->getGroup(1) == L"Date") m_Date = m0->getGroup(2); + if (m0->getGroup(1) == L"Version") m_Version = m0->getGroup(2); + if (m0->getGroup(1) == L"ButtonSmiley") m_ButtonSmiley = m0->getGroup(2); } delete m0; delete otherf; @@ -416,7 +415,7 @@ bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& win.y = 0; { _TPattern * pat = _TPattern::compile( - _T("^\\s*(Selection|Window)Size\\s*=\\s*(\\d+)\\s*,\\s*(\\d+)"), + L"^\\s*(Selection|Window)Size\\s*=\\s*(\\d+)\\s*,\\s*(\\d+)", _TPattern::MULTILINE_MATCHING); _TMatcher * m0 = pat->createTMatcher(tbuf); while (m0->findNextMatch()) @@ -425,9 +424,9 @@ bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& tpt.x = _ttol(m0->getGroup(2).c_str()); tpt.y = _ttol(m0->getGroup(3).c_str()); - if (m0->getGroup(1) == _T("Selection")) + if (m0->getGroup(1) == L"Selection") selec = tpt; - else if (m0->getGroup(1) == _T("Window")) + else if (m0->getGroup(1) == L"Window") win = tpt; } delete m0; @@ -435,12 +434,12 @@ bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& } _TPattern * smiley = _TPattern::compile( - _T("^\\s*Smiley(\\*)?\\s*=") // Is Hidden - _T("(?:\\s*\"(.*)\")") // Smiley file name - _T("(?:[\\s,]+(\\-?\\d+))") // Icon resource id - _T("(?:[\\s,]+(R|S)?\"(.*?)\")") // Trigger text - _T("(?:[\\s,]+\"(.*?)\")?") // Tooltip or insert text - _T("(?:[\\s,]+\"(.*?)\")?"), // Tooltip text + L"^\\s*Smiley(\\*)?\\s*=" // Is Hidden + L"(?:\\s*\"(.*)\")" // Smiley file name + L"(?:[\\s,]+(\\-?\\d+))" // Icon resource id + L"(?:[\\s,]+(R|S)?\"(.*?)\")" // Trigger text + L"(?:[\\s,]+\"(.*?)\")?" // Tooltip or insert text + L"(?:[\\s,]+\"(.*?)\")?", // Tooltip text _TPattern::MULTILINE_MATCHING); _TMatcher * m0 = smiley->createTMatcher(tbuf); @@ -451,7 +450,7 @@ bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& while (m0->findNextMatch()) { bkstring resname = m0->getGroup(2); - if (resname.find(_T("http://")) != resname.npos) + if (resname.find(L"http://") != resname.npos) { if (GetSmileyFile(resname, packstr)) continue; } @@ -467,8 +466,8 @@ bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& dat->SetHidden(m0->getStartingIndex(1) >= 0); if (m0->getStartingIndex(4) >= 0) { - dat->SetRegEx(m0->getGroup(4) == _T("R")); - dat->SetService(m0->getGroup(4) == _T("S")); + dat->SetRegEx(m0->getGroup(4) == L"R"); + dat->SetService(m0->getGroup(4) == L"S"); } dat->m_TriggerText = m0->getGroup(5); if (dat->IsRegEx()) @@ -506,7 +505,7 @@ bool SmileyPackType::LoadSmileyFileMSL(bkstring& tbuf, bool onlyInfo, bkstring& if (!noerr) { - static const TCHAR errmsg[] = _T("Smiley #%u in file %s for Smiley Pack %s not found."); + static const TCHAR errmsg[] = LPGENT("Smiley #%u in file %s for Smiley Pack %s not found."); TCHAR msgtxt[1024]; mir_sntprintf(msgtxt, SIZEOF(msgtxt), TranslateTS(errmsg), smnum, resname.c_str(), modpath.c_str()); CallService(MS_NETLIB_LOG,(WPARAM) hNetlibUser, (LPARAM)(char*)T2A_SM(msgtxt)); @@ -532,8 +531,8 @@ static void DecodeHTML(bkstring& str) { if (str.find('&') != str.npos) { - str = _TPattern::replace(bkstring(_T("<")), str, bkstring(_T("<"))); - str = _TPattern::replace(bkstring(_T(">")), str, bkstring(_T(">"))); + str = _TPattern::replace(bkstring(L"<"), str, bkstring(L"<")); + str = _TPattern::replace(bkstring(L">"), str, bkstring(L">")); } } @@ -566,11 +565,11 @@ bool SmileyPackType::LoadSmileyFileXEP(bkstring& tbuf, bool onlyInfo, bkstring& { _TMatcher *m0, *m1, *m2; - _TPattern * dbname_re = _TPattern::compile(_T("\\s*\"(.*?)\"\\s*"), + _TPattern * dbname_re = _TPattern::compile(L"\\s*\"(.*?)\"\\s*", _TPattern::MULTILINE_MATCHING); - _TPattern * author_re = _TPattern::compile(_T("\\s*\"(.*?)\"\\s*"), + _TPattern * author_re = _TPattern::compile(L"\\s*\"(.*?)\"\\s*", _TPattern::MULTILINE_MATCHING); - _TPattern * settings_re = _TPattern::compile(_T("(.*?)"), + _TPattern * settings_re = _TPattern::compile(L"(.*?)", _TPattern::MULTILINE_MATCHING | _TPattern::DOT_MATCHES_ALL); m0 = settings_re->createTMatcher(tbuf); @@ -602,17 +601,17 @@ bool SmileyPackType::LoadSmileyFileXEP(bkstring& tbuf, bool onlyInfo, bkstring& if (!onlyInfo) { - _TPattern * record_re = _TPattern::compile(_T("(?:\\s*\"(.*?)\")?(.*?)"), + _TPattern * record_re = _TPattern::compile(L"(?:\\s*\"(.*?)\")?(.*?)", _TPattern::MULTILINE_MATCHING | _TPattern::DOT_MATCHES_ALL); - _TPattern * expression_re = _TPattern::compile(_T("\\s*\"(.*?)\"\\s*"), + _TPattern * expression_re = _TPattern::compile(L"\\s*\"(.*?)\"\\s*", _TPattern::MULTILINE_MATCHING); - _TPattern * pastetext_re = _TPattern::compile(_T("\\s*\"(.*?)\"\\s*"), + _TPattern * pastetext_re = _TPattern::compile(L"\\s*\"(.*?)\"\\s*", _TPattern::MULTILINE_MATCHING); - _TPattern * images_re = _TPattern::compile(_T("(.*?)"), + _TPattern * images_re = _TPattern::compile(L"(.*?)", _TPattern::MULTILINE_MATCHING | _TPattern::DOT_MATCHES_ALL); - _TPattern * image_re = _TPattern::compile(_T("(.*?)"), + _TPattern * image_re = _TPattern::compile(L"(.*?)", _TPattern::MULTILINE_MATCHING | _TPattern::DOT_MATCHES_ALL); - _TPattern * imagedt_re = _TPattern::compile(_T(""), + _TPattern * imagedt_re = _TPattern::compile(L"", _TPattern::MULTILINE_MATCHING ); m0 = images_re->createTMatcher(tbuf); @@ -1037,7 +1036,7 @@ SmileyLookup::SmileyLookup(const bkstring& str, const bool regexs, const int ind m_ind = ind; if (regexs) { - static const bkstring testString(_T("Test String")); + static const bkstring testString(L"Test String"); m_pattern = _TPattern::compile(str); m_valid = m_pattern != NULL; if (m_valid) @@ -1047,14 +1046,14 @@ SmileyLookup::SmileyLookup(const bkstring& str, const bool regexs, const int ind matcher->getStartingIndex() != matcher->getEndingIndex()); if (!m_valid) { - static const TCHAR errmsg[] = _T("Regular Expression \"%s\" in smiley pack \"%s\" could produce \"empty matches\"."); + static const TCHAR errmsg[] = LPGENT("Regular Expression \"%s\" in smiley pack \"%s\" could produce \"empty matches\"."); mir_sntprintf(msgtxt, SIZEOF(msgtxt), TranslateTS(errmsg), str.c_str(), smpt.c_str()); } delete matcher; } else { - static const TCHAR errmsg[] = _T("Regular Expression \"%s\" in smiley pack \"%s\" malformed.") ; + static const TCHAR errmsg[] = LPGENT("Regular Expression \"%s\" in smiley pack \"%s\" malformed.") ; mir_sntprintf(msgtxt, SIZEOF(msgtxt), TranslateTS(errmsg), str.c_str(), smpt.c_str()); } -- cgit v1.2.3