summaryrefslogtreecommitdiff
path: root/plugins/Variables/contact.cpp
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-06-16 14:33:30 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-06-16 14:33:30 +0000
commit05c989e58aeffcfb59cebaca6797cb69dd25cb1e (patch)
tree460bde28df51ea7b01109b56818b5880ac47ba66 /plugins/Variables/contact.cpp
parentac7bf920f219a7aed7eb163c8b3195e66c12e4da (diff)
another portion of "#ifdef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@446 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Variables/contact.cpp')
-rw-r--r--plugins/Variables/contact.cpp32
1 files changed, 10 insertions, 22 deletions
diff --git a/plugins/Variables/contact.cpp b/plugins/Variables/contact.cpp
index 93c48052ec..c6b7b8f566 100644
--- a/plugins/Variables/contact.cpp
+++ b/plugins/Variables/contact.cpp
@@ -303,11 +303,9 @@ static TCHAR* getContactInfo(BYTE type, HANDLE hContact)
TCHAR *getContactInfoT(BYTE type, HANDLE hContact, int tchar)
{
if (tchar) {
- #ifdef UNICODE
+
return getContactInfo((BYTE)(type|CNF_UNICODE), hContact);
- #else
- return getContactInfo(type, hContact);
- #endif
+
}
return getContactInfo(type, hContact);
@@ -330,22 +328,16 @@ int getContactFromString( CONTACTSINFO* ci )
return -1;
if (ci->flags&CI_UNICODE) {
- #ifdef UNICODE
+
tszContact = NEWTSTR_ALLOCA(ci->tszContact);
- #else
- char* tmp = u2a(ci->wszContact);
- tszContact = NEWTSTR_ALLOCA(tmp);
- free( tmp );
- #endif
+
}
else {
- #ifdef UNICODE
+
WCHAR* tmp = a2u(ci->szContact);
tszContact = NEWTSTR_ALLOCA(tmp);
free(tmp);
- #else
- tszContact = NEWTSTR_ALLOCA(ci->szContact);
- #endif
+
}
if ( (tszContact == NULL) || (_tcslen(tszContact) == 0) )
return -1;
@@ -399,11 +391,9 @@ int getContactFromString( CONTACTSINFO* ci )
else {
szFind = ( TCHAR* )malloc((_tcslen(cInfo) + strlen(szProto) + 4)*sizeof(TCHAR));
if (szFind != NULL) {
-#ifdef UNICODE
+
tszProto = a2u(szProto);
-#else
- tszProto = _strdup(szProto);
-#endif
+
if ( (tszProto != NULL) && (szFind != NULL) ) {
wsprintf(szFind, _T("<%s:%s>"), tszProto, cInfo);
free(cInfo);
@@ -603,11 +593,9 @@ TCHAR *encodeContactToString(HANDLE hContact)
if (tszResult == NULL)
return NULL;
- #ifdef UNICODE
+
tszProto = a2u(szProto);
- #else
- tszProto = _strdup(szProto);
- #endif
+
if (tszProto == NULL)
return NULL;