From a4f31a97e407280dc7e306a6c96948b53f9c0cab Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 3 Apr 2013 18:05:17 +0000 Subject: SmileyAdd: - array indexes totally unborkred; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@4296 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SmileyAdd/src/services.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'plugins/SmileyAdd/src/services.cpp') diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index ecf3339f51..64b8c71d06 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -49,10 +49,10 @@ SmileyPackType* GetSmileyPack(const char* proto, HANDLE hContact, SmileyPackCTyp if (protonam != NULL) { DBVARIANT dbv; - if (DBGetContactSettingTString(hContact, protonam, "Transport", &dbv) == 0) + if (db_get_ts(hContact, protonam, "Transport", &dbv) == 0) { categoryName = dbv.ptszVal; - DBFreeVariant(&dbv); + db_free(&dbv); } else categoryName = A2T_SM(protonam); @@ -306,23 +306,21 @@ INT_PTR ParseTextBatch(WPARAM, LPARAM lParam) else LookupAllSmileys(SmileyPack, smcp, A2T_SM(smre->astr), smllist, false); - if (smllist.getCount() == 0) return 0; + if (smllist.getCount() == 0) + return 0; SMADD_BATCHPARSERES *res = new SMADD_BATCHPARSERES[smllist.getCount()]; SMADD_BATCHPARSERES* cres = res; - for (int j = 0; j < smllist.getCount(); j++) - { + for (int j=0; j < smllist.getCount(); j++) { cres->startChar = smllist[j].loc.cpMin; cres->size = smllist[j].loc.cpMax - smllist[j].loc.cpMin; - if (smllist[j].sml) - { + if (smllist[j].sml) { if (smre->flag & SAFL_PATH) cres->filepath = smllist[j].sml->GetFilePath().c_str(); else cres->hIcon = smllist[j].sml->GetIconDup(); } - else - { + else { if (smre->flag & SAFL_PATH) cres->filepath = smllist[j].smlc->GetFilePath().c_str(); else @@ -384,7 +382,7 @@ INT_PTR CustomCatMenu(WPARAM wParam, LPARAM lParam) NotifyEventHooks(hEvent1, (WPARAM)hContact, 0); } - for (int i = 0; i < menuHandleArray.getCount(); i++) + for (int i=0; i < menuHandleArray.getCount(); i++) CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)menuHandleArray[i], 0); menuHandleArray.destroy(); @@ -403,7 +401,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) bool haveMenu = IsSmileyProto(protnam); if (haveMenu && opt.UseOneForAll) { unsigned cnt = 0; - for (int i=0; i < smc.getCount(); ++i) + for (int i=0; i < smc.getCount(); i++) cnt += smc[i].IsCustom(); haveMenu = cnt != 0; } @@ -412,7 +410,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuItem, (LPARAM)&mi); - for (int i = 0; i < menuHandleArray.getCount(); ++i) + for (int i=0; i < menuHandleArray.getCount(); i++) CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)menuHandleArray[i], 0); menuHandleArray.destroy(); -- cgit v1.2.3