summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_clc.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-04-14 15:11:35 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-04-14 15:11:35 +0000
commit6c174c43ea46ffdd89fcfbe6cdd0497a64b06fc9 (patch)
tree7feed44f643806c47b30de87e0ce955e952209cb /plugins/Clist_modern/src/modern_clc.cpp
parent583f3768d24ceb7b0bee451f9a0975d25f826ee6 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@16653 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_clc.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp59
1 files changed, 31 insertions, 28 deletions
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index 5b79dede54..169089957b 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -1243,38 +1243,41 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
break;
case DROPTARGET_INSERTION:
- {
ClcContact *contact, *destcontact;
ClcGroup *group, *destgroup;
- BOOL NeedRename = FALSE;
- TCHAR newName[128] = { 0 };
- pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
- int i = pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
- if (i != -1 && group->groupId != destgroup->groupId) {
- TCHAR *groupName = mir_tstrdup(pcli->pfnGetGroupName(contact->groupId, 0));
- TCHAR *shortGroup = NULL;
- TCHAR *sourceGrName = mir_tstrdup(pcli->pfnGetGroupName(destgroup->groupId, 0));
- if (groupName) {
- int len = (int)mir_tstrlen(groupName);
- do { len--; } while (len >= 0 && groupName[len] != '\\');
- if (len >= 0) shortGroup = groupName + len + 1;
- else shortGroup = groupName;
- }
- if (shortGroup) {
- NeedRename = TRUE;
- if (sourceGrName)
- mir_sntprintf(newName, _T("%s\\%s"), sourceGrName, shortGroup);
- else
- mir_tstrncpy(newName, shortGroup, _countof(newName));
+ {
+ BOOL NeedRename = FALSE;
+ TCHAR newName[128] = { 0 };
+ pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
+ int i = pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
+ if (i != -1 && group->groupId != destgroup->groupId) {
+ TCHAR *groupName = mir_tstrdup(pcli->pfnGetGroupName(contact->groupId, 0));
+ TCHAR *shortGroup = NULL;
+ TCHAR *sourceGrName = mir_tstrdup(pcli->pfnGetGroupName(destgroup->groupId, 0));
+ if (groupName) {
+ int len = (int)mir_tstrlen(groupName);
+ do { len--; } while (len >= 0 && groupName[len] != '\\');
+ if (len >= 0)
+ shortGroup = groupName + len + 1;
+ else
+ shortGroup = groupName;
+ }
+ if (shortGroup) {
+ NeedRename = TRUE;
+ if (sourceGrName)
+ mir_sntprintf(newName, _T("%s\\%s"), sourceGrName, shortGroup);
+ else
+ mir_tstrncpy(newName, shortGroup, _countof(newName));
+ }
+ mir_free(groupName);
+ mir_free(sourceGrName);
}
- mir_free(groupName);
- mir_free(sourceGrName);
+ int newIndex = CallService(MS_CLIST_GROUPMOVEBEFORE, contact->groupId, (destcontact && i != -1) ? destcontact->groupId : 0);
+ newIndex = newIndex ? newIndex : contact->groupId;
+ if (NeedRename)
+ pcli->pfnRenameGroup(newIndex, newName);
}
- int newIndex = CallService(MS_CLIST_GROUPMOVEBEFORE, contact->groupId, (destcontact && i != -1) ? destcontact->groupId : 0);
- newIndex = newIndex ? newIndex : contact->groupId;
- if (NeedRename) pcli->pfnRenameGroup(newIndex, newName);
- }
- break;
+ break;
case DROPTARGET_OUTSIDE:
corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);