diff options
author | George Hazan <george.hazan@gmail.com> | 2016-02-26 09:12:35 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-02-26 09:12:35 +0000 |
commit | a16909cbcbf6d18ab622ac5bbb05a8d743a93db3 (patch) | |
tree | 11e893c6f97aa15c7d2cceabf3fd455b418b6cde | |
parent | 178cc2dfec49d71e591471c31a33ac229debffe1 (diff) |
crash fix for drag-n-drop in trees
git-svn-id: http://svn.miranda-ng.org/main/trunk@16343 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | src/mir_core/src/ui_utils.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index de9d41bb11..3d89cc49a2 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -1460,12 +1460,15 @@ LRESULT CCtrlTreeView::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam) else if (hti.flags & TVHT_BELOW)
hti.hItem = TVI_LAST;
- HTREEITEM insertAfter = hti.hItem;
- HTREEITEM hParent = (insertAfter == TVI_FIRST) ? NULL : GetParent(insertAfter);
- if (GetChild(insertAfter) != NULL) {
- hParent = insertAfter;
- insertAfter = TVI_FIRST;
+ HTREEITEM insertAfter = hti.hItem, hParent;
+ if (insertAfter != TVI_FIRST) {
+ hParent = GetParent(insertAfter);
+ if (GetChild(insertAfter) != NULL) {
+ hParent = insertAfter;
+ insertAfter = TVI_FIRST;
+ }
}
+ else hParent = NULL;
HTREEITEM FirstItem = NULL;
if (m_bMultiSelect) {
|