summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-01-20 12:57:15 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-01-20 12:57:15 +0000
commit4874e848f64514f3d6f76e2f0e341a67e791b6eb (patch)
treea200e92ea8f6b6edf4b32955212304845e92600f
parent73e3511b96f7c85600a25d75b30d48d854f4b412 (diff)
fix to prevent insertion of sub-sub-items into the level of parent submenu
git-svn-id: http://svn.miranda-ng.org/main/trunk@16125 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--src/mir_core/src/ui_utils.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp
index 55f8f3d1fa..9559a7fabd 100644
--- a/src/mir_core/src/ui_utils.cpp
+++ b/src/mir_core/src/ui_utils.cpp
@@ -1467,9 +1467,12 @@ LRESULT CCtrlTreeView::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam)
// Proceed moving
HTREEITEM insertAfter = hti.hItem;
+ HTREEITEM hParent = GetParent(hti.hItem);
for (int i = 0; i < arItems.getCount(); i++) {
if (!insertAfter)
break;
+ if (GetParent(arItems[i]) != hParent) // prevent subitems from being inserted at the same level
+ continue;
insertAfter = MoveItemAbove(arItems[i], insertAfter);
if (!i)