From 1dd73910cbbf9062b62b4713ff88427011fcac85 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Fri, 6 Mar 2015 23:28:19 +0000 Subject: Clist_nicer: - Minor cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@12364 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/src/extBackg.cpp | 47 +++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 17 deletions(-) (limited to 'plugins/Clist_nicer/src/extBackg.cpp') diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 61892d0c33..b43cececcd 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -1219,7 +1219,7 @@ void IMG_LoadItems() void LoadPerContactSkins(TCHAR *tszFileName) { - char *p, szItem[100]; + char szItem[100]; char *szSections = reinterpret_cast(malloc(3002)); StatusItems_t *items = NULL, *this_item; int i = 1; @@ -1230,7 +1230,7 @@ void LoadPerContactSkins(TCHAR *tszFileName) ReadItem(&default_item, "%Default", file); memset(szSections, 0, 3000); - p = szSections; + char *p = szSections; GetPrivateProfileSectionNamesA(szSections, 3000, file); szSections[3001] = szSections[3000] = 0; p = szSections; @@ -1264,7 +1264,8 @@ void LoadPerContactSkins(TCHAR *tszFileName) char *uid = (char *)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0); if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid != NULL) { DBVARIANT dbv = {0}; - db_get(hContact, szProto, uid, &dbv); + if (db_get(hContact, szProto, uid, &dbv)) + return; char UIN[40]; switch (dbv.type) { @@ -1328,20 +1329,32 @@ void extbk_import(char *file, HWND hwndDlg) if (p->statusID == ID_EXTBKSEPARATOR) continue; - char *pszEnd = buffer + mir_snprintf(buffer, SIZEOF(buffer), "%s_", p->szDBname); - strcpy(pszEnd, "ALPHA"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->ALPHA), sizeof(p->ALPHA), file); - strcpy(pszEnd, "COLOR"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR), sizeof(p->COLOR), file); - strcpy(pszEnd, "COLOR2"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR2), sizeof(p->COLOR2), file); - strcpy(pszEnd, "COLOR2_TRANSPARENT"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR2_TRANSPARENT), sizeof(p->COLOR2_TRANSPARENT), file); - strcpy(pszEnd, "TEXTCOLOR"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->TEXTCOLOR), sizeof(p->TEXTCOLOR), file); - strcpy(pszEnd, "CORNER"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->CORNER), sizeof(p->CORNER), file); - strcpy(pszEnd, "GRADIENT"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->GRADIENT), sizeof(p->GRADIENT), file); - strcpy(pszEnd, "IGNORED"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->IGNORED), sizeof(p->IGNORED), file); - strcpy(pszEnd, "MARGIN_BOTTOM"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_BOTTOM), sizeof(p->MARGIN_BOTTOM), file); - strcpy(pszEnd, "MARGIN_LEFT"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_LEFT), sizeof(p->MARGIN_LEFT), file); - strcpy(pszEnd, "MARGIN_RIGHT"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_RIGHT), sizeof(p->MARGIN_RIGHT), file); - strcpy(pszEnd, "MARGIN_TOP"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_TOP), sizeof(p->MARGIN_TOP), file); - strcpy(pszEnd, "BORDERSTYLE"); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->BORDERSTYLE), sizeof(p->BORDERSTYLE), file); + mir_snprintf(buffer, SIZEOF(buffer), "%s_ALPHA", p->szDBname); + GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->ALPHA), sizeof(p->ALPHA), file); + mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR", p->szDBname); + GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR), sizeof(p->COLOR), file); + mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR2", p->szDBname); + GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR2), sizeof(p->COLOR2), file); + mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR2_TRANSPARENT", p->szDBname); + GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR2_TRANSPARENT), sizeof(p->COLOR2_TRANSPARENT), file); + mir_snprintf(buffer, SIZEOF(buffer), "%s_TEXTCOLOR", p->szDBname); + GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->TEXTCOLOR), sizeof(p->TEXTCOLOR), file); + mir_snprintf(buffer, SIZEOF(buffer), "%s_CORNER", p->szDBname); + GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->CORNER), sizeof(p->CORNER), file); + mir_snprintf(buffer, SIZEOF(buffer), "%s_GRADIENT", p->szDBname); + GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->GRADIENT), sizeof(p->GRADIENT), file); + mir_snprintf(buffer, SIZEOF(buffer), "%s_IGNORED", p->szDBname); + GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->IGNORED), sizeof(p->IGNORED), file); + mir_snprintf(buffer, SIZEOF(buffer), "%s_MARGIN_BOTTOM", p->szDBname); + GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_BOTTOM), sizeof(p->MARGIN_BOTTOM), file); + mir_snprintf(buffer, SIZEOF(buffer), "%s_MARGIN_LEFT", p->szDBname); + GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_LEFT), sizeof(p->MARGIN_LEFT), file); + mir_snprintf(buffer, SIZEOF(buffer), "%s_MARGIN_RIGHT", p->szDBname); + GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_RIGHT), sizeof(p->MARGIN_RIGHT), file); + mir_snprintf(buffer, SIZEOF(buffer), "%s_MARGIN_TOP", p->szDBname); + GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_TOP), sizeof(p->MARGIN_TOP), file); + mir_snprintf(buffer, SIZEOF(buffer), "%s_BORDERSTYLE", p->szDBname); + GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->BORDERSTYLE), sizeof(p->BORDERSTYLE), file); } data = 0; -- cgit v1.2.3