summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-11-30 20:25:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-11-30 20:25:58 +0000
commitce2d4f19e3f810b282eb7d47d470d426ff459e1f (patch)
treea49f3e9dd42399756b2ce33a3d91caec535b77ab /plugins/UserInfoEx
parent1bb83288c063ce1864e46f6f675751c8c631b530 (diff)
mir_strcmp, mir_strcmpi, mir_wstrcmp, mir_wstrcmpi
git-svn-id: http://svn.miranda-ng.org/main/trunk@11179 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx')
-rw-r--r--plugins/UserInfoEx/src/classPsTree.cpp2
-rw-r--r--plugins/UserInfoEx/src/classPsTreeItem.cpp4
-rw-r--r--plugins/UserInfoEx/src/ctrl_edit.cpp2
-rw-r--r--plugins/UserInfoEx/src/dlg_anniversarylist.cpp2
-rw-r--r--plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp2
-rw-r--r--plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp22
-rw-r--r--plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp16
-rw-r--r--plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp2
-rw-r--r--plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp2
-rw-r--r--plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp6
-rw-r--r--plugins/UserInfoEx/src/mir_string.h6
11 files changed, 30 insertions, 36 deletions
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp
index aecab3b6a7..4d774b0d2d 100644
--- a/plugins/UserInfoEx/src/classPsTree.cpp
+++ b/plugins/UserInfoEx/src/classPsTree.cpp
@@ -118,7 +118,7 @@ BYTE CPsTree::Create(HWND hWndTree, CPsHdr* pPsh)
**/
int CPsTree::AddDummyItem(LPCSTR pszGroup)
{
- if (mir_stricmp(pszGroup, TREE_ROOTITEM))
+ if (mir_strcmpi(pszGroup, TREE_ROOTITEM))
{
CPsHdr psh;
psh._hContact = _pPs->hContact;
diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp
index 2969b61fd5..44f4e81a40 100644
--- a/plugins/UserInfoEx/src/classPsTreeItem.cpp
+++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp
@@ -31,7 +31,7 @@ BOOL CALLBACK BoldGroupTitlesEnumChildren(HWND hWnd, LPARAM lParam)
{
TCHAR szClass[64];
GetClassName(hWnd, szClass, 64);
- if (!mir_tcscmp(szClass, _T("Button")) && (GetWindowLongPtr(hWnd, GWL_STYLE) & 0x0F) == BS_GROUPBOX)
+ if (!mir_tstrcmp(szClass, _T("Button")) && (GetWindowLongPtr(hWnd, GWL_STYLE) & 0x0F) == BS_GROUPBOX)
SendMessage(hWnd, WM_SETFONT, lParam, NULL);
return TRUE;
}
@@ -202,7 +202,7 @@ int CPsTreeItem::Name(LPTSTR ptszTitle, const BYTE bIsUnicode)
**/
BYTE CPsTreeItem::HasName(const LPCSTR pszName) const
{
- return !mir_stricmp(_pszName, pszName);
+ return !mir_strcmpi(_pszName, pszName);
};
/**
diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp
index cf9511b7f1..2a7d65fede 100644
--- a/plugins/UserInfoEx/src/ctrl_edit.cpp
+++ b/plugins/UserInfoEx/src/ctrl_edit.cpp
@@ -269,7 +269,7 @@ void CEditCtrl::OnChangedByUser(WORD wChangedMsg)
if (szText != NULL) {
GetWindowText(_hwnd, szText, cch + 1);
- _Flags.B.hasChanged = mir_tcscmp(_pszValue, szText);
+ _Flags.B.hasChanged = mir_tstrcmp(_pszValue, szText);
if (need_free)
MIR_FREE(szText);
} else {
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp
index b62aee6d93..e7776df2dc 100644
--- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp
+++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp
@@ -242,7 +242,7 @@ class CAnnivList
case COLUMN_DESC:
ListView_GetItemText(pDlg->_hList, iItem1, pDlg->_sortHeader, szText1, MAX_PATH);
ListView_GetItemText(pDlg->_hList, iItem2, pDlg->_sortHeader, szText2, MAX_PATH);
- result = pDlg->_sortOrder * mir_tcscmp(szText1, szText2);
+ result = pDlg->_sortOrder * mir_tstrcmp(szText1, szText2);
break;
case COLUMN_AGE:
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
index ead8d33c9d..2b4fd52fc3 100644
--- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
+++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
@@ -503,7 +503,7 @@ BYTE CExImContactBase::isHandle(MCONTACT hContact)
}
// compare nicknames if no UID
else if (!DB::Setting::GetUString(hContact, _pszProto, SET_CONTACT_NICK, &dbv)) {
- if (dbv.type == DBVT_UTF8 && dbv.pszVal && !mir_stricmp(dbv.pszVal,_pszNick)) {
+ if (dbv.type == DBVT_UTF8 && dbv.pszVal && !mir_strcmpi(dbv.pszVal,_pszNick)) {
LPTSTR ptszNick = mir_utf8decodeT(_pszNick);
LPTSTR ptszProto = mir_a2t(_pszProto);
int ans = MsgBox(NULL, MB_ICONQUESTION|MB_YESNO, LPGENT("Question"), LPGENT("contact identification"),
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
index 0dcd377b73..c33bc8aaf8 100644
--- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
+++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
@@ -421,7 +421,7 @@ BYTE CExImContactXML::ExportEvents()
// find module
TiXmlNode *xmlModule;
for (xmlModule = _xmlNode->FirstChild(); xmlModule != NULL; xmlModule = xmlModule->NextSibling())
- if (!mir_stricmp(((TiXmlElement*)xmlModule)->Attribute("key"), dbei.szModule))
+ if (!mir_strcmpi(((TiXmlElement*)xmlModule)->Attribute("key"), dbei.szModule))
break;
// create new module
@@ -463,7 +463,7 @@ void CExImContactXML::CountKeys(DWORD &numSettings, DWORD &numEvents)
for (TiXmlNode *xkey = xmod->FirstChild();
xkey != NULL;
xkey = xkey->NextSibling()) {
- if (!mir_stricmp(xkey->Value(), XKEY_SET))
+ if (!mir_strcmpi(xkey->Value(), XKEY_SET))
numSettings++;
else
numEvents++;
@@ -526,7 +526,7 @@ int CExImContactXML::LoadXmlElemnt(TiXmlElement *xContact)
uidk (xContact->Attribute("uidk"));
if (!_pszProto) {
// check if this is the owner contact
- if (mir_stricmp(xContact->Value(), XKEY_OWNER))
+ if (mir_strcmpi(xContact->Value(), XKEY_OWNER))
return ERROR_INVALID_PARAMS;
_hContact = NULL;
_xmlNode = xContact;
@@ -773,7 +773,7 @@ int CExImContactXML::ImportMetaSubContact(CExImContactXML * pMetaContact)
int CExImContactXML::ImportModule(TiXmlNode* xmlModule)
{
// check if parent is really a module
- if (!xmlModule || mir_stricmp(xmlModule->Value(), XKEY_MOD))
+ if (!xmlModule || mir_strcmpi(xmlModule->Value(), XKEY_MOD))
return ERROR_INVALID_SIGNATURE;
// convert to element
@@ -787,14 +787,14 @@ int CExImContactXML::ImportModule(TiXmlNode* xmlModule)
return ERROR_INVALID_PARAMS;
// ignore Modul 'Protocol' as it would cause trouble
- if (!mir_stricmp(pszModule, "Protocol"))
+ if (!mir_strcmpi(pszModule, "Protocol"))
return ERROR_OK;
for (TiXmlElement *xKey = xmlModule->FirstChildElement(); xKey != NULL; xKey = xKey->NextSiblingElement()) {
// import setting
- if (!mir_stricmp(xKey->Value(), XKEY_SET)) {
+ if (!mir_strcmpi(xKey->Value(), XKEY_SET)) {
// check if the module to import is the contact's protocol module
- BYTE isProtoModule = !mir_stricmp(pszModule, _pszProto)/* || DB::Module::IsMeta(pszModule)*/;
+ BYTE isProtoModule = !mir_strcmpi(pszModule, _pszProto)/* || DB::Module::IsMeta(pszModule)*/;
BYTE isMetaModule = DB::Module::IsMeta(pszModule);
// just ignore MetaModule on normal contact to avoid errors (only keys)
@@ -803,9 +803,9 @@ int CExImContactXML::ImportModule(TiXmlNode* xmlModule)
// just ignore MetaModule on Meta to avoid errors (only import spetial keys)
if (isProtoModule && isMetaModule) {
- if (!mir_stricmp(xKey->Attribute("key"),"Nick") ||
- !mir_stricmp(xKey->Attribute("key"),"TzName") ||
- !mir_stricmp(xKey->Attribute("key"),"Timezone"))
+ if (!mir_strcmpi(xKey->Attribute("key"),"Nick") ||
+ !mir_strcmpi(xKey->Attribute("key"),"TzName") ||
+ !mir_strcmpi(xKey->Attribute("key"),"Timezone"))
{
if (ImportSetting(pszModule, xKey->ToElement()) == ERROR_OK)
_pXmlFile->_numSettingsDone++;
@@ -826,7 +826,7 @@ int CExImContactXML::ImportModule(TiXmlNode* xmlModule)
return ERROR_ABORTED;
}
// import event
- else if (!mir_stricmp(xKey->Value(), XKEY_EVT)) {
+ else if (!mir_strcmpi(xKey->Value(), XKEY_EVT)) {
int error = ImportEvent(pszModule, xKey->ToElement());
switch (error) {
case ERROR_OK:
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp
index 0e294afdfe..a5346841d4 100644
--- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp
+++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp
@@ -95,7 +95,7 @@ HTREEITEM ExportTree_FindItem(HWND hTree, HTREEITEM hParent, LPSTR pszText)
tvi.hItem != NULL;
tvi.hItem = TreeView_GetNextSibling(hTree, tvi.hItem))
{
- if (SendMessageA(hTree, TVM_GETITEMA, NULL, (LPARAM)&tvi) && !mir_stricmp(tvi.pszText, pszText))
+ if (SendMessageA(hTree, TVM_GETITEMA, NULL, (LPARAM)&tvi) && !mir_strcmpi(tvi.pszText, pszText))
return tvi.hItem;
}
return NULL;
@@ -318,7 +318,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar
}
// contact's base protocol is to be added to the treeview uniquely
- if (!mir_stricmp(p, pszProto))
+ if (!mir_strcmpi(p, pszProto))
{
if (!ExportTree_FindItem(hTree, hItemEssential, p))
{
@@ -329,7 +329,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar
// add optional module, which is valid for at least one contact
/*/Filter/*/
- if (mir_stricmp(p, USERINFO) && mir_stricmp(p, MOD_MBIRTHDAY) && mir_stricmp(p, META_PROTO))
+ if (mir_strcmpi(p, USERINFO) && mir_strcmpi(p, MOD_MBIRTHDAY) && mir_strcmpi(p, META_PROTO))
{
ExportTree_AddItem(hTree, hItemOptional, p, bImagesLoaded, 1);
break;
@@ -342,10 +342,10 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar
else if (
/*Filter/*/
!DB::Module::IsEmpty(pDat->ExImContact->hContact, p) &&
- (!pDat->ExImContact->hContact || mir_stricmp(p, pszProto)) &&
- //mir_stricmp(p, "Protocol") &&
- mir_stricmp(p, USERINFO) &&
- mir_stricmp(p, MOD_MBIRTHDAY))
+ (!pDat->ExImContact->hContact || mir_strcmpi(p, pszProto)) &&
+ //mir_strcmpi(p, "Protocol") &&
+ mir_strcmpi(p, USERINFO) &&
+ mir_strcmpi(p, MOD_MBIRTHDAY))
{
ExportTree_AddItem(hTree, hItemOptional, (LPSTR)p, bImagesLoaded, 1);
}
@@ -401,7 +401,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar
tvi.hItem != NULL && SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&tvi);
tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)tvi.hItem))
{
- if (!mir_stricmp(tvi.pszText, pszRoot)) {
+ if (!mir_strcmpi(tvi.pszText, pszRoot)) {
tvi.mask = TVIF_STATE;
tvi.state = INDEXTOSTATEIMAGEMASK(LOWORD(wParam) == BTN_UNCHECK ? 1 : 2);
tvi.stateMask = TVIS_STATEIMAGEMASK;
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp
index 9c0787ff8b..09bcaa0469 100644
--- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp
+++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp
@@ -224,7 +224,7 @@ BYTE CProgress::UpdateSetting(LPCTSTR pszFormat, ...)
mir_vsntprintf(buf, SIZEOF(buf), TranslateTS(pszFormat), vl);
va_end(vl);
GetDlgItemText(_hDlg, TXT_SETTING, tmp, SIZEOF(tmp));
- if (mir_tcsicmp(tmp,buf))
+ if (mir_tstrcmpi(tmp,buf))
SetDlgItemText(_hDlg, TXT_SETTING, buf);
}
SendMessage(hProg, PBM_SETPOS, (int)SendMessage(hProg, PBM_GETPOS, 0, 0) + 1, 0);
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp
index 7c126562fa..42aa54c2b4 100644
--- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp
+++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp
@@ -144,7 +144,7 @@ static BYTE ExportContact(MCONTACT hContact, DB::CEnumList* pModules, FILE* file
p = (*pModules)[i];
/*Filter/
- if (mir_stricmp(p, "Protocol"))*/
+ if (mir_strcmpi(p, "Protocol"))*/
{
ExportModule(hContact, p, file);
}
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp
index 12cfcf2a1f..6f5158a941 100644
--- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp
+++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp
@@ -256,7 +256,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent)
// import contacts
for (xContact = xmlParent->FirstChildElement(); xContact != NULL; xContact = xContact->NextSiblingElement()) {
- if (!mir_stricmp(xContact->Value(), XKEY_CONTACT)) {
+ if (!mir_strcmpi(xContact->Value(), XKEY_CONTACT)) {
// update progressbar and abort if user clicked cancel
pszNick = mir_utf8decodeT(xContact->Attribute("nick"));
// user clicked abort button
@@ -295,7 +295,7 @@ int CFileXml::ImportContacts(TiXmlElement* xmlParent)
if (pszNick) mir_free(pszNick);
}
// import owner contact
- else if (_hContactToWorkOn == INVALID_CONTACT_ID && !mir_stricmp(xContact->Value(), XKEY_OWNER) && (vContact = xContact)) {
+ else if (_hContactToWorkOn == INVALID_CONTACT_ID && !mir_strcmpi(xContact->Value(), XKEY_OWNER) && (vContact = xContact)) {
result = vContact.Import();
switch (result) {
case ERROR_OK:
@@ -327,7 +327,7 @@ DWORD CFileXml::CountContacts(TiXmlElement* xmlParent)
try {
// count contacts in file for progress bar
for (xContact = xmlParent->FirstChild(); xContact != NULL; xContact = xContact->NextSibling()) {
- if (!mir_stricmp(xContact->Value(), XKEY_CONTACT) || !mir_stricmp(xContact->Value(), XKEY_OWNER)) {
+ if (!mir_strcmpi(xContact->Value(), XKEY_CONTACT) || !mir_strcmpi(xContact->Value(), XKEY_OWNER)) {
dwCount += CountContacts(xContact->ToElement()) + 1;
}
}
diff --git a/plugins/UserInfoEx/src/mir_string.h b/plugins/UserInfoEx/src/mir_string.h
index 9e075820be..82f0dcaf69 100644
--- a/plugins/UserInfoEx/src/mir_string.h
+++ b/plugins/UserInfoEx/src/mir_string.h
@@ -22,25 +22,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef _MIR_STRING_H_INCLUDED_
#define _MIR_STRING_H_INCLUDED_
-#define mir_tcscmp mir_wcscmp
#define mir_tcsncmp mir_wcsncmp
-#define mir_tcsicmp mir_wcsicmp
#define mir_tcsnicmp mir_wcsnicmp
#define mir_tcschr mir_wcschr
#define mir_tcsrchr mir_wcsrchr
#define mir_tcsncat_c mir_wcsncat_c
#define mir_IsEmpty mir_IsEmptyW
-#define mir_strcmp(s1,s2) ((s1)==0||(s2)==0||strcmp((s1),(s2)))
#define mir_strncmp(s1,s2,n) ((s1)==0||(s2)==0||strncmp((s1),(s2),(n)))
-#define mir_stricmp(s1,s2) ((s1)==0||(s2)==0||_stricmp((s1),(s2)))
#define mir_strnicmp(s1,s2,n) ((s1)==0||(s2)==0||_strnicmp((s1),(s2),(n)))
#define mir_strchr(s,c) (((s)!=0)?strchr((s),(c)):0)
#define mir_strrchr(s,c) (((s)!=0)?strrchr((s),(c)):0)
-#define mir_wcscmp(s1,s2) ((s1)==0||(s2)==0||wcscmp((s1),(s2)))
#define mir_wcsncmp(s1,s2,n) ((s1)==0||(s2)==0||wcsncmp((s1),(s2),(n)))
-#define mir_wcsicmp(s1,s2) ((s1)==0||(s2)==0||_wcsicmp((s1),(s2)))
#define mir_wcsnicmp(s1,s2,n) ((s1)==0||(s2)==0||_wcsnicmp((s1),(s2),(n)))
#define mir_wcschr(s,c) (((s)!=0)?wcschr((s),(c)):0)
#define mir_wcsrchr(s,c) (((s)!=0)?wcsrchr((s),(c)):0)