diff options
author | George Hazan <george.hazan@gmail.com> | 2013-01-31 22:07:54 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-01-31 22:07:54 +0000 |
commit | df60e52a47f80d89de55affae33d93f79e077885 (patch) | |
tree | 8122a0eb58d5f397244fe7f1d057ab0bbc85e7e8 /plugins/Utils/mir_smileys.cpp | |
parent | 1eafcf387847f384eca282abfe5fa7242e1405ab (diff) |
unicode smileys never worked in MyDetails
git-svn-id: http://svn.miranda-ng.org/main/trunk@3382 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Utils/mir_smileys.cpp')
-rw-r--r-- | plugins/Utils/mir_smileys.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/plugins/Utils/mir_smileys.cpp b/plugins/Utils/mir_smileys.cpp index de0844950a..e512273c17 100644 --- a/plugins/Utils/mir_smileys.cpp +++ b/plugins/Utils/mir_smileys.cpp @@ -406,28 +406,20 @@ void DestroySmileyList( SortedList* p_list ) // Generete the list of smileys / text to be drawn
SortedList * ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height)
{
- SMADD_BATCHPARSE2 sp = {0};
- SMADD_BATCHPARSERES *spres;
-
*max_smiley_height = 0;
if (text[0] == '\0' || !ServiceExists(MS_SMILEYADD_BATCHPARSE))
- {
return NULL;
- }
// Parse it!
- sp.cbSize = sizeof(sp);
+ SMADD_BATCHPARSE2 sp = { sizeof(sp) };
sp.Protocolname = protocol;
sp.str = (TCHAR*)text;
- sp.oflag = SAFL_TCHAR;
- spres = (SMADD_BATCHPARSERES *) CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&sp);
-
+ sp.flag = SAFL_TCHAR;
+ SMADD_BATCHPARSERES *spres = (SMADD_BATCHPARSERES *) CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&sp);
if (spres == NULL)
- {
// Did not find a simley
return NULL;
- }
// Lets add smileys
SortedList *plText = List_Create(0, 10);
@@ -435,16 +427,13 @@ SortedList * ReplaceSmileys(const TCHAR *text, int text_size, const char *protoc const TCHAR *next_text_pos = text;
const TCHAR *last_text_pos = _tcsninc(text, text_size);
- for (unsigned int i = 0; i < sp.numSmileys; i++)
- {
+ for (unsigned int i = 0; i < sp.numSmileys; i++) {
TCHAR* start = _tcsninc(text, spres[i].startChar);
TCHAR* end = _tcsninc(start, spres[i].size);
- if (spres[i].hIcon != NULL) // For deffective smileypacks
- {
+ if (spres[i].hIcon != NULL) { // For defective smileypacks
// Add text
- if (start > next_text_pos)
- {
+ if (start > next_text_pos) {
TextPiece *piece = (TextPiece *) mir_calloc(sizeof(TextPiece));
piece->type = TEXT_PIECE_TYPE_TEXT;
|