summaryrefslogtreecommitdiff
path: root/plugins/QuickMessages
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-06-15 20:04:13 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-06-15 20:04:13 +0000
commite521b812384a0e93f48e078c6cb248913dcc893a (patch)
tree13b1de3e9bef13a48af0318f1fd338915dd69e9a /plugins/QuickMessages
parentae481600939fb5420b80a8a7ef84f0ce9d6b3356 (diff)
another portion of "#ifsef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@437 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/QuickMessages')
-rw-r--r--plugins/QuickMessages/Utils.c18
-rw-r--r--plugins/QuickMessages/main.c36
-rw-r--r--plugins/QuickMessages/quickmessages.h8
3 files changed, 21 insertions, 41 deletions
diff --git a/plugins/QuickMessages/Utils.c b/plugins/QuickMessages/Utils.c
index 8adf1a13bd..41b3710664 100644
--- a/plugins/QuickMessages/Utils.c
+++ b/plugins/QuickMessages/Utils.c
@@ -474,11 +474,9 @@ TCHAR* ParseString(HANDLE hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptsz
TCHAR* p=NULL;
int NameLenght=0;
TCHAR* ptszName=NULL;
-#ifdef _UNICODE
+
ptszName=mir_a2u((char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0));
-#else
- ptszName=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
-#endif
+
NameLenght=(int)_tcslen(ptszName);
p=realloc(tempQValue, (QVSize+NameLenght+1)*sizeof(TCHAR));
@@ -538,11 +536,9 @@ TCHAR* ParseString(HANDLE hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptsz
ZeroMemory(&ci,sizeof(CONTACTINFO));
ci.cbSize = sizeof(CONTACTINFO);
ci.hContact = hContact;
-#ifdef UNICODE
+
ci.dwFlag =CNF_FIRSTNAME|CNF_UNICODE;
-#else
- ci.dwFlag =CNF_FIRSTNAME;
-#endif
+
ci.szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (!CallService(MS_CONTACT_GETCONTACTINFO,(WPARAM)0,(LPARAM)&ci)&&ci.pszVal){
NameLenght=(int)_tcslen(ci.pszVal);
@@ -578,11 +574,9 @@ TCHAR* ParseString(HANDLE hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptsz
ci.cbSize = sizeof(CONTACTINFO);
ci.hContact = hContact;
ci.szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
-#ifdef UNICODE
+
ci.dwFlag =CNF_LASTNAME|CNF_UNICODE;
-#else
- ci.dwFlag =CNF_LASTNAME;
-#endif
+
if (!CallService(MS_CONTACT_GETCONTACTINFO,(WPARAM)0,(LPARAM)&ci)&&ci.pszVal){
NameLenght=(int)_tcslen(ci.pszVal);
ptszName=ci.pszVal;
diff --git a/plugins/QuickMessages/main.c b/plugins/QuickMessages/main.c
index b1957c89eb..ea51b49eda 100644
--- a/plugins/QuickMessages/main.c
+++ b/plugins/QuickMessages/main.c
@@ -111,11 +111,9 @@ static int InputMenuPopup(WPARAM wParam,LPARAM lParam)
HANDLE hData=NULL;
TCHAR* chBuffer=NULL;
int textLength=0;
-#ifdef _UNICODE
+
hData= GetClipboardData(CF_UNICODETEXT);
-#else
- hData = GetClipboardData(CF_TEXT);
-#endif
+
chBuffer= (TCHAR*)GlobalLock(hData);
textLength=(int)_tcslen(chBuffer);
pszCBText=mir_tstrdup(chBuffer);
@@ -136,11 +134,9 @@ static int InputMenuPopup(WPARAM wParam,LPARAM lParam)
if(qd->ptszValue){
ptszQValue=ParseString(mwpd->hContact,qd->ptszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)_tcslen(qd->ptszValue),textlenght,pszCBText?(int)_tcslen(pszCBText):0);
if ((bIsService=qd->bIsService)&&ptszQValue)
-#ifdef _UNICODE
+
CallService(mir_u2a(ptszQValue),(WPARAM)mwpd->hContact,0);
-#else
- CallService(ptszQValue,(WPARAM)mwpd->hContact,0);
-#endif
+
}
if(ptszQValue)
@@ -190,11 +186,9 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
HANDLE hData=NULL;
TCHAR* chBuffer=NULL;
int textLength=0;
-#ifdef _UNICODE
+
hData= GetClipboardData(CF_UNICODETEXT);
-#else
- hData = GetClipboardData(CF_TEXT);
-#endif
+
chBuffer= (TCHAR*)GlobalLock(hData);
textLength=(int)_tcslen(chBuffer);
pszCBText=mir_tstrdup(chBuffer);
@@ -236,11 +230,9 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
if(ButtonsList[cbcd->dwButtonId]->ptszQValue)
ptszQValue=ParseString(cbcd->hContact,ButtonsList[cbcd->dwButtonId]->ptszQValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)_tcslen(ButtonsList[cbcd->dwButtonId]->ptszQValue),textlenght,pszCBText?(int)_tcslen(pszCBText):0);
if ((bIsService=ButtonsList[cbcd->dwButtonId]->bIsServName)&&ptszQValue)
-#ifdef _UNICODE
+
CallService(mir_u2a(ptszQValue),(WPARAM)cbcd->hContact,0);
-#else
- CallService(ptszQValue,(WPARAM)cbcd->hContact,0);
-#endif
+
break;
case 2:
{
@@ -249,11 +241,9 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
if(bd&&bd->pszValue){
ptszQValue=ParseString(cbcd->hContact,bd->pszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)_tcslen(bd->pszValue),textlenght,pszCBText?(int)_tcslen(pszCBText):0);
if ((bIsService=bd->bIsServName)&&ptszQValue)
-#ifdef _UNICODE
+
CallService(mir_u2a(ptszQValue),(WPARAM)cbcd->hContact,0);
-#else
- CallService(ptszQValue,(WPARAM)cbcd->hContact,0);
-#endif
+
}
}
break;
@@ -300,11 +290,9 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
if(bd->pszValue){
ptszQValue=ParseString(cbcd->hContact,bd->pszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)_tcslen(bd->pszValue),textlenght,pszCBText?(int)_tcslen(pszCBText):0);
if ((bIsService=bd->bIsServName)&&ptszQValue)
-#ifdef _UNICODE
+
CallService(mir_u2a(ptszQValue),(WPARAM)cbcd->hContact,0);
-#else
- CallService(ptszQValue,(WPARAM)cbcd->hContact,0);
-#endif
+
}
}break;
}
diff --git a/plugins/QuickMessages/quickmessages.h b/plugins/QuickMessages/quickmessages.h
index 4931697b2b..c5e9d851a3 100644
--- a/plugins/QuickMessages/quickmessages.h
+++ b/plugins/QuickMessages/quickmessages.h
@@ -72,11 +72,9 @@ int OptionsInit(WPARAM,LPARAM);
#define SIZEOF(X)(sizeof(X)/sizeof(X[0]))
-#ifdef _UNICODE
-#define QMESSAGES_NAME "quickmessages_u"
-#else
-#define QMESSAGES_NAME "quickmessages_a"
-#endif
+
+#define QMESSAGES_NAME "quickmessages"
+
#define QMESSAGES_VERSION_URL "http://miranda.radicaled.ru/public/updater/quickmessages.txt"