diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-06-12 19:25:54 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-06-12 19:25:54 +0000 |
commit | b1a65d2ed1a74b0c4700f61e93232a3b0a32d3aa (patch) | |
tree | 95d73acbdee7c1f0632a6506b590062b6d9b8488 /plugins/SmileyAdd/src/services.cpp | |
parent | e74411f50d715f467a378ae77d8feee11d03a1a2 (diff) |
Smileyadd deprecated header moved
git-svn-id: http://svn.miranda-ng.org/main/trunk@9440 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SmileyAdd/src/services.cpp')
-rw-r--r-- | plugins/SmileyAdd/src/services.cpp | 131 |
1 files changed, 8 insertions, 123 deletions
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index 776c07415e..0a591ae1ab 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -73,7 +73,7 @@ SmileyPackType* GetSmileyPack(const char* proto, MCONTACT hContact, SmileyPackCT INT_PTR ReplaceSmileysCommand(WPARAM, LPARAM lParam)
{
SMADD_RICHEDIT3* smre = (SMADD_RICHEDIT3*) lParam;
- if (smre == NULL || smre->cbSize < SMADD_RICHEDIT_SIZE_V1)
+ if (smre == NULL)
return FALSE;
SMADD_RICHEDIT3 smrec = {0};
@@ -98,9 +98,9 @@ INT_PTR ShowSmileySelectionCommand(WPARAM, LPARAM lParam) {
SMADD_SHOWSEL3* smaddInfo = (SMADD_SHOWSEL3*) lParam;
- if (smaddInfo == NULL || smaddInfo->cbSize < SMADD_SHOWSEL_SIZE_V1) return FALSE;
- HWND parent = smaddInfo->cbSize > SMADD_SHOWSEL_SIZE_V1 ? smaddInfo->hwndParent : NULL;
- MCONTACT hContact = smaddInfo->cbSize > SMADD_SHOWSEL_SIZE_V2 ? smaddInfo->hContact : NULL;
+ if (smaddInfo == NULL) return FALSE;
+ HWND parent = smaddInfo->hwndParent;
+ MCONTACT hContact = smaddInfo->hContact;
SmileyToolWindowParam *stwp = new SmileyToolWindowParam;
stwp->pSmileyPack = GetSmileyPack(smaddInfo->Protocolname, hContact);
@@ -119,43 +119,11 @@ INT_PTR ShowSmileySelectionCommand(WPARAM, LPARAM lParam) return TRUE;
}
-INT_PTR GetSmileyIconCommand(WPARAM, LPARAM lParam)
-{
- SMADD_GETICON* smre = (SMADD_GETICON*) lParam;
-
- if (smre == NULL || smre->cbSize < sizeof(SMADD_GETICON)) return FALSE;
-
- SmileyPackType* SmileyPack = GetSmileyPack(smre->Protocolname);
-
- if (SmileyPack == NULL || IsBadStringPtrA(smre->SmileySequence, MAX_SMILEY_LENGTH)) {
- smre->SmileyIcon = NULL;
- smre->Smileylength = 0;
- return FALSE;
- }
-
- unsigned start, size;
- SmileyType* sml;
- FindSmileyInText(SmileyPack, A2T_SM(smre->SmileySequence), start, size, &sml);
-
- if (size == 0 || start != 0)
- {
- smre->SmileyIcon = NULL;
- smre->Smileylength = 0;
- }
- else
- {
- smre->SmileyIcon = sml->GetIcon();
- smre->Smileylength = size;
- }
-
- return TRUE;
-}
-
static int GetInfoCommandE(SMADD_INFO2* smre, bool retDup)
{
- if (smre == NULL || smre->cbSize < SMADD_INFO_SIZE_V1) return FALSE;
- MCONTACT hContact = smre->cbSize > SMADD_INFO_SIZE_V1 ? smre->hContact : NULL;
+ if (smre == NULL) return FALSE;
+ MCONTACT hContact = smre->hContact;
SmileyPackType* SmileyPack = GetSmileyPack(smre->Protocolname, hContact);
@@ -193,96 +161,13 @@ INT_PTR GetInfoCommand2(WPARAM, LPARAM lParam) }
-INT_PTR ParseText(WPARAM, LPARAM lParam)
-{
- SMADD_PARSE* smre = (SMADD_PARSE*) lParam;
-
- if (smre == NULL || smre->cbSize < sizeof(SMADD_PARSE)) return FALSE;
-
- SmileyPackType* SmileyPack = GetSmileyPack(smre->Protocolname);
-
- if (SmileyPack == NULL)
- {
- smre->SmileyIcon = NULL;
- smre->size = 0;
- return FALSE;
- }
-
- unsigned strtChrOff = smre->startChar + smre->size;
- char* workstr = smre->str + strtChrOff;
-
- if (strtChrOff > 1024 || IsBadStringPtrA(workstr, 10))
- {
- smre->SmileyIcon = NULL;
- smre->size = 0;
- return FALSE;
- }
-
- SmileyType* sml;
- FindSmileyInText(SmileyPack, A2T_SM(workstr), smre->startChar, smre->size, &sml);
-
- if (smre->size == 0)
- {
- smre->SmileyIcon = NULL;
- }
- else
- {
- smre->SmileyIcon = sml->GetIconDup();
- smre->startChar += strtChrOff;
- }
-
- return TRUE;
-}
-
-
-INT_PTR ParseTextW(WPARAM, LPARAM lParam)
-{
- SMADD_PARSEW* smre = (SMADD_PARSEW*) lParam;
-
- if (smre == NULL || smre->cbSize < sizeof(SMADD_PARSEW)) return FALSE;
-
- SmileyPackType* SmileyPack = GetSmileyPack(smre->Protocolname);
-
- if (SmileyPack == NULL)
- {
- smre->SmileyIcon = NULL;
- smre->size = 0;
- return FALSE;
- }
-
- unsigned strtChrOff = smre->startChar + smre->size;
- wchar_t* workstr = smre->str + strtChrOff;
-
- if (strtChrOff > 1024 || IsBadStringPtrW(workstr, 10))
- {
- smre->SmileyIcon = NULL;
- smre->size = 0;
- return FALSE;
- }
-
- SmileyType* sml;
- FindSmileyInText(SmileyPack, workstr, smre->startChar, smre->size, &sml);
-
- if (smre->size == 0)
- {
- smre->SmileyIcon = NULL;
- }
- else
- {
- smre->SmileyIcon = sml->GetIconDup();
- smre->startChar += strtChrOff;
- }
-
- return TRUE;
-}
-
INT_PTR ParseTextBatch(WPARAM, LPARAM lParam)
{
SMADD_BATCHPARSE2* smre = (SMADD_BATCHPARSE2*) lParam;
- if (smre == NULL || smre->cbSize < SMADD_BATCHPARSE_SIZE_V1) return FALSE;
- MCONTACT hContact = smre->cbSize > SMADD_BATCHPARSE_SIZE_V1 ? smre->hContact : NULL;
+ if (smre == NULL) return FALSE;
+ MCONTACT hContact = smre->hContact;
SmileyPackCType* smcp = NULL;
SmileyPackType* SmileyPack = GetSmileyPack(smre->Protocolname, hContact,
|