diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-16 14:33:30 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-16 14:33:30 +0000 |
commit | 05c989e58aeffcfb59cebaca6797cb69dd25cb1e (patch) | |
tree | 460bde28df51ea7b01109b56818b5880ac47ba66 /plugins/Variables/tokenregister.cpp | |
parent | ac7bf920f219a7aed7eb163c8b3195e66c12e4da (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/tokenregister.cpp')
-rw-r--r-- | plugins/Variables/tokenregister.cpp | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/plugins/Variables/tokenregister.cpp b/plugins/Variables/tokenregister.cpp index 74da8858a3..c9b13e674f 100644 --- a/plugins/Variables/tokenregister.cpp +++ b/plugins/Variables/tokenregister.cpp @@ -115,17 +115,14 @@ INT_PTR registerToken(WPARAM wParam, LPARAM lParam) hash = NameHashFunction( newVr->tszTokenString );
}
else {
-#ifdef UNICODE
+
WCHAR *wtoken;
wtoken = a2u( newVr->szTokenString );
deRegisterToken( wtoken );
hash = NameHashFunction( wtoken );
free( wtoken );
-#else
- deRegisterToken( newVr->szTokenString );
- hash = NameHashFunction( newVr->szTokenString );
-#endif
+
}
tre = ( TokenRegisterEntry* )malloc( sizeof( TokenRegisterEntry ));
@@ -143,11 +140,9 @@ INT_PTR registerToken(WPARAM wParam, LPARAM lParam) if ( newVr->flags & TRF_TCHAR )
tre->tr.tszTokenString = _tcsdup( newVr->tszTokenString );
else
-#ifdef UNICODE
+
tre->tr.tszTokenString = a2u( newVr->szTokenString );
-#else
- tre->tr.szTokenString = _strdup( newVr->szTokenString );
-#endif
+
if ( newVr->szHelpText != NULL )
tre->tr.szHelpText = _strdup( newVr->szHelpText );
@@ -205,7 +200,7 @@ TCHAR *parseFromRegister(ARGUMENTSINFO *ai) trCopy = *thisVr;
-#ifdef UNICODE
+
// ai contains WCHARs, convert to chars because the tr doesn't support WCHARs
if ( !( thisVr->flags & TRF_TCHAR )) {
// unicode variables calls a non-unicode plugin
@@ -239,17 +234,7 @@ TCHAR *parseFromRegister(ARGUMENTSINFO *ai) if (( TCHAR* )callRes != NULL )
res = _tcsdup(( TCHAR* )callRes );
}
-#else
- // non-unicode variables, should call non-unicode plugin (assume)
- // ai contains chars, tr shouldn't use WCHARs
- if ( thisVr->flags & TRF_PARSEFUNC )
- callRes = (int)thisVr->parseFunction(ai);
- else if ( thisVr->szService != NULL )
- callRes = CallService( thisVr->szService, (WPARAM)0, (LPARAM)ai );
-
- if (( char* )callRes != NULL )
- res = _strdup(( char* )callRes );
-#endif
+
if (( void* )callRes != NULL ) {
if ( trCopy.flags & TRF_CLEANUP ) {
|